Browse Source

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

Ludovic Courtès 13 years ago
parent
commit
cf05aa7f13
1 changed files with 3 additions and 2 deletions
  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);
 		}