Explorar o código

tests/loader: Fix interpretation the return value of waitpid(2).

Ludovic Courtès %!s(int64=13) %!d(string=hai) anos
pai
achega
cf05aa7f13
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      tests/loader.c

+ 3 - 2
tests/loader.c

@@ -96,9 +96,10 @@ static void launch_gdb(const char *exe)
 
 	default:				  /* parent */
 		{
+			pid_t who;
 			int status;
-			err = waitpid(pid, &status, 0);
-			if (err != 0)
+			who = waitpid(pid, &status, 0);
+			if (who != pid)
 				fprintf(stderr, "while waiting for gdb "
 					"process %d: %m\n", pid);
 		}