bugfix
[oweals/gnunet.git] / src / util / os_priority.c
index 0dfc9cafe8bf7a7f52652228dd22ddf1850c6493..4e820b8d5cfda1e8efb95d06e35228edb407e762 100644 (file)
@@ -272,10 +272,9 @@ GNUNET_OS_process_status (pid_t proc, enum GNUNET_OS_ProcessStatusType *type,
   int status;
   int ret;
 
-  ret = waitpid (0, &status, WNOHANG);
-  if ( (0 == ret) ||
-       ( (-1 == ret) &&
-        (ECHILD == errno) ) )
+  GNUNET_assert (0 != proc);
+  ret = waitpid (proc, &status, WNOHANG);
+  if (0 == ret) 
     {
       *type = GNUNET_OS_PROCESS_RUNNING;
       *code = 0;