From: thib Date: Sat, 6 Mar 2010 10:37:58 +0000 (+0000) Subject: Fixed warning on freopen() return value not checked X-Git-Tag: ver3_0_5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a69e3e76e17e6ca3bfc0d6327d24253ac0b189e6;p=fcron Fixed warning on freopen() return value not checked --- diff --git a/job.c b/job.c index 0edc4bd..b748b49 100644 --- 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"); } }