From 6aedae0b42434c95f22924ed4b93ba726353f034 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 19 Sep 2017 20:37:13 -0400 Subject: [PATCH] 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 --- src/libopensrf/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.11.0