From: Rémi Denis-Courmont Date: Mon, 17 Dec 2007 16:16:53 +0000 (+0000) Subject: Fix error handling X-Git-Tag: 0.9.0-test0~4037 X-Git-Url: https://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=29d53bdc58deaad0880f0a61aadef47c49127ec5;hp=c3131c092fde04fe625aa4ac6b9588ce99a63c64 Fix error handling --- diff --git a/modules/misc/screensaver.c b/modules/misc/screensaver.c index 55239817a2..3e0093bd28 100644 --- a/modules/misc/screensaver.c +++ b/modules/misc/screensaver.c @@ -148,9 +148,9 @@ static void Execute( intf_thread_t *p_this, const char *const *ppsz_args ) pthread_sigmask (SIG_SETMASK, &set, NULL); /* We don't want output */ - freopen( "/dev/null", "w", stdout ); - freopen( "/dev/null", "w", stderr ); - execv( ppsz_args[0] , (char *const *)ppsz_args ); + if( ( freopen( "/dev/null", "w", stdout ) != NULL ) + && ( freopen( "/dev/null", "w", stderr ) != NULL ) ) + execv( ppsz_args[0] , (char *const *)ppsz_args ); /* If the file we want to execute doesn't exist we exit() */ exit( EXIT_FAILURE ); }