fixing waitpid usage issues
authorChristian Grothoff <christian@grothoff.org>
Fri, 12 Jun 2009 00:52:23 +0000 (00:52 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 12 Jun 2009 00:52:23 +0000 (00:52 +0000)
src/util/os_priority.c

index 0dfc9cafe8bf7a7f52652228dd22ddf1850c6493..16537dfcdc7abd36480c316d0cc01f45030f23b9 100644 (file)
@@ -272,7 +272,8 @@ GNUNET_OS_process_status (pid_t proc, enum GNUNET_OS_ProcessStatusType *type,
   int status;
   int ret;
 
-  ret = waitpid (0, &status, WNOHANG);
+  GNUNET_assert (0 != proc);
+  ret = waitpid (proc, &status, WNOHANG);
   if ( (0 == ret) ||
        ( (-1 == ret) &&
         (ECHILD == errno) ) )