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
+8 -1
View File
@@ -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;