From a69e3e76e17e6ca3bfc0d6327d24253ac0b189e6 Mon Sep 17 00:00:00 2001 From: thib Date: Sat, 6 Mar 2010 10:37:58 +0000 Subject: [PATCH] Fixed warning on freopen() return value not checked --- job.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); } } -- 2.49.0