From: Chris Sharp Date: Wed, 20 Sep 2017 00:37:13 +0000 (-0400) Subject: LP#1243841 - Quiet unused return value warnings. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6aedae0b42434c95f22924ed4b93ba726353f034;p=working%2FOpenSRF.git LP#1243841 - Quiet unused return value warnings. Using advice given here: https://stackoverflow.com/a/13999461, "The only good (if ugly) way to suppress these is to convert the return value into something that the compiler agrees that you can ignore." Signed-off-by: Chris Sharp Signed-off-by: Jason Stephenson Signed-off-by: Galen Charlton --- diff --git a/src/libopensrf/utils.c b/src/libopensrf/utils.c index 1c049c0..ff0afc3 100644 --- a/src/libopensrf/utils.c +++ b/src/libopensrf/utils.c @@ -667,16 +667,16 @@ int daemonizeWithCallback( void (*callback)(pid_t, int), int callback_arg ) { // Change directories. Otherwise whatever directory // we're in couldn't be deleted until the program // terminated -- possibly causing some inconvenience. - chdir( "/" ); + (void) (chdir( "/" )+1); /* create new session */ setsid(); // Now that we're no longer attached to a terminal, // we don't want any traffic on the standard streams - freopen( "/dev/null", "r", stdin ); - freopen( "/dev/null", "w", stdout ); - freopen( "/dev/null", "w", stderr ); + (void) (freopen( "/dev/null", "r", stdin )+1); + (void) (freopen( "/dev/null", "w", stdout )+1); + (void) (freopen( "/dev/null", "w", stderr )+1); return 0;