Be more consistent about checking for errors from close()

This commit is contained in:
Eric Fischer
2016-12-06 17:19:22 -08:00
parent 94bebbd276
commit 72478ae13e
3 changed files with 16 additions and 3 deletions
+4 -1
View File
@@ -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);
}