diff --git a/decode.cpp b/decode.cpp index 879d73d..96eb396 100644 --- a/decode.cpp +++ b/decode.cpp @@ -102,7 +102,10 @@ void decode(char *fname, int z, unsigned x, unsigned y) { } else { perror("fstat"); } - close(fd); + if (close(fd) != 0) { + perror("close"); + exit(EXIT_FAILURE); + } } else { perror(fname); } diff --git a/main.cpp b/main.cpp index ca4bd86..61d174b 100644 --- a/main.cpp +++ b/main.cpp @@ -2167,7 +2167,14 @@ int main(int argc, char **argv) { } files_open_at_start = open("/dev/null", O_RDONLY); - close(files_open_at_start); + if (files_open_at_start < 0) { + perror("open /dev/null"); + exit(EXIT_FAILURE); + } + if (close(files_open_at_start) != 0) { + perror("close"); + exit(EXIT_FAILURE); + } if (full_detail <= 0) { full_detail = 12; diff --git a/tile-join.cpp b/tile-join.cpp index 29bd001..ff863c3 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -617,7 +617,10 @@ void readcsv(char *fn, std::vector &header, std::map