]> granicus.if.org Git - fcron/commitdiff
Fixed warning on freopen() return value not checked ver3_0_5
authorthib <thib@berseker.(none)>
Sat, 6 Mar 2010 10:37:58 +0000 (10:37 +0000)
committerthib <thib@berseker.(none)>
Sat, 6 Mar 2010 10:37:58 +0000 (10:37 +0000)
job.c

diff --git a/job.c b/job.c
index 0edc4bd35b7cb3df2b979ccd303a331034c9f67a..b748b49f20e4cf7ce3f3a31f80f2fe52d9471d85 100644 (file)
--- a/job.c
+++ b/job.c
@@ -376,8 +376,10 @@ run_job_grand_child_setup_stderr_stdout(cl_t *line, int *pipe_fd)
 #endif
     }
     else if ( foreground ) {
-       freopen("/dev/null", "w", stdout);
-       freopen("/dev/null", "w", stderr);
+       if ( freopen("/dev/null", "w", stdout) == NULL )
+            error_e("could not freopen /dev/null as stdout");
+       if ( freopen("/dev/null", "w", stderr) == NULL )
+            error_e("could not freopen /dev/null as stderr");
     }
     
 }