Quiet warning about freopen() of stdout

This commit is contained in:
Nicolas Williams committed 2014-08-20 20:49:30 -05:00
1 parent 8d2d5e37e5
commit 23e2e2eab3
1 file changed
+8 -3
+8 -3
View File
@@ -479,13 +479,18 @@ int main(int argc, char* argv[]) {
}
}
if ((options & IN_PLACE)) {
FILE *devnull;
#ifdef WIN32
(void) freopen("NUL", "w+", stdout);
devnull = freopen("NUL", "w+", stdout);
#else
(void) freopen("/dev/null", "w+", stdout);
devnull = freopen("/dev/null", "w+", stdout);
#endif
if (devnull == NULL) {
fprintf(stderr, "Error: %s opening /dev/null\n", strerror(errno));
exit(3);
}
if (rename(t, input_filenames[0]) == -1) {
fprintf(stderr, "Error: %s renaming temporary file", strerror(errno));
fprintf(stderr, "Error: %s renaming temporary file\n", strerror(errno));
exit(3);
}
jv_mem_free(t);