[PATCH 2/3] wmload: Fix -Wunused-result compiler warning.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
Obtained from the Debian package [1].

[1] https://sources.debian.net/src/wmload/0.9.6-1/debian/patches/fix_unused_result.patch/
---
 wmload/wmload.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/wmload/wmload.c b/wmload/wmload.c
index c30f7bf..eeab18b 100644
--- a/wmload/wmload.c
+++ b/wmload/wmload.c
@@ -145,7 +145,9 @@ void ExecuteExternal()
 	ruid = getuid();
 	euid = geteuid();
 	if ( ruid == euid ) {
-		system( Execute );
+		if (system( Execute ) == -1)
+			fprintf(stderr, "system(%s) returned an error",
+				Execute);
 		return;
 	}
 	pid = fork();
@@ -171,7 +173,8 @@ void ExecuteExternal()
 				strerror(errno));
 		exit(127);
 	}
-	system( Execute );
+	if (system( Execute ) == -1)
+		fprintf(stderr, "system(%s) returned an error", Execute);
 	exit(0);
 }
 int main(int argc,char *argv[])
-- 
2.1.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.