Browse Source

Log a warning if --cmd-* returns a non-zero exit code

Luke Dashjr 12 years ago
parent
commit
525426c6f5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      util.c

+ 3 - 1
util.c

@@ -2454,7 +2454,9 @@ void *cmd_thread(void *cmdp)
 {
 {
 	const char *cmd = cmdp;
 	const char *cmd = cmdp;
 	applog(LOG_DEBUG, "Executing command: %s", cmd);
 	applog(LOG_DEBUG, "Executing command: %s", cmd);
-	system(cmd);
+	int rc = system(cmd);
+	if (rc)
+		applog(LOG_WARNING, "Command returned %d exit code: %s", rc, cmd);
 	return NULL;
 	return NULL;
 }
 }