Преглед на файлове

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

Ludovic Courtès преди 13 години
родител
ревизия
cf05aa7f13
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  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);
 		}