Explorar o código

Add a required NULL to execl

	 And add a more descriptive error for issue #100
Marc Di Luzio %!s(int64=6) %!d(string=hai) anos
pai
achega
f09ce2a96c
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      daemon/gamemode-tests.c

+ 5 - 2
daemon/gamemode-tests.c

@@ -182,8 +182,11 @@ static int run_dual_client_tests(void)
 	int child = fork();
 	if (child == 0) {
 		/* Relaunch self with -r (request and wait for signal) */
-		if (execl(mypath, mypath, "-r") == -1) {
-			fprintf(stderr, "ERROR: failed to re-launch self with execv: %s\n", strerror(errno));
+		if (execl(mypath, mypath, "-r", (char *)NULL) == -1) {
+			fprintf(stderr,
+			        "ERROR: failed to re-launch self (%s) with execv: %s\n",
+			        mypath,
+			        strerror(errno));
 			return -1;
 		}
 	}