소스 검색

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);
 		}