diff options
author | 2020-02-15 21:10:46 +0200 | |
---|---|---|
committer | 2020-02-15 21:10:46 +0200 | |
commit | 8d72ffe268305a823057053f6a172ac7debee3b0 (patch) | |
tree | b2ceb490c89702527c32e467044f4701b67c6a17 /src/main.c | |
parent | 671cef6ab353a6143f88622a86049681ee19e8f4 (diff) | |
download | algos-ld1-8d72ffe268305a823057053f6a172ac7debee3b0.tar.gz algos-ld1-8d72ffe268305a823057053f6a172ac7debee3b0.tar.bz2 algos-ld1-8d72ffe268305a823057053f6a172ac7debee3b0.zip |
add a wrapper for closing files.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,4 +1,3 @@ -#include <unistd.h> #include <errno.h> #include <stddef.h> #include <stdlib.h> @@ -31,7 +30,7 @@ int main(int argc, char **argv) file_in.name = settings.filein; file_in.stride = 0; /* TODO */ - if ((ret = openstream(&file_in))) { + if ((ret = stream_open(&file_in))) { goto out; } @@ -40,13 +39,13 @@ int main(int argc, char **argv) file_out.n = file_in.n; file_out.stride = 0; /* TODO */ - if ((ret = openstream(&file_out))) { + if ((ret = stream_open(&file_out))) { goto out; } out: - close(file_in.fd); - close(file_out.fd); + stream_close(&file_in); + stream_close(&file_out); return ret; } |