summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-04-18 14:50:14 -0700
committerKeith Packard <keithp@keithp.com>2014-04-18 16:30:17 -0700
commit696e08f8e820449bb4b0ce7a60bf5b5bc5097935 (patch)
tree5877637942506a672ae344e9f96a261917dcfd8c
parent570b1c79942b237022be3594ae3a25e7b833cb73 (diff)
kdrive: Explicitly ignore errors from the -switchCmd script
Make it clear that we intentionally ignore the -switchCmd return value. This keeps GCC from emitting a warning when the server is compiled with -D_FORTIFY_SOURCE=2. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
-rw-r--r--hw/kdrive/src/kdrive.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 8eb8cd02e..9814fc66a 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -118,10 +118,17 @@ KdDoSwitchCmd(const char *reason)
{
if (kdSwitchCmd) {
char *command;
+ int ret;
if (asprintf(&command, "%s %s", kdSwitchCmd, reason) == -1)
return;
- system(command);
+
+ /* Ignore the return value from system; I'm not sure
+ * there's anything more useful to be done when
+ * it fails
+ */
+ ret = system(command);
+ (void) ret;
free(command);
}
}