Quiet warning about freopen() of stdout
This commit is contained in:
1 parent
8d2d5e37e5
commit
23e2e2eab3
1 file changed
+8
-3
@@ -479,13 +479,18 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((options & IN_PLACE)) {
|
if ((options & IN_PLACE)) {
|
||||||
|
FILE *devnull;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
(void) freopen("NUL", "w+", stdout);
|
devnull = freopen("NUL", "w+", stdout);
|
||||||
#else
|
#else
|
||||||
(void) freopen("/dev/null", "w+", stdout);
|
devnull = freopen("/dev/null", "w+", stdout);
|
||||||
#endif
|
#endif
|
||||||
|
if (devnull == NULL) {
|
||||||
|
fprintf(stderr, "Error: %s opening /dev/null\n", strerror(errno));
|
||||||
|
exit(3);
|
||||||
|
}
|
||||||
if (rename(t, input_filenames[0]) == -1) {
|
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);
|
exit(3);
|
||||||
}
|
}
|
||||||
jv_mem_free(t);
|
jv_mem_free(t);
|
||||||
|
|||||||
Reference in new issue
Block a user