-LRN: make watchdog always kill its children
authorChristian Grothoff <christian@grothoff.org>
Thu, 31 May 2012 16:49:27 +0000 (16:49 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 31 May 2012 16:49:27 +0000 (16:49 +0000)
contrib/timeout_watchdog_w32.c

index 286d39a94cef60596057af87132776accb6dbe45..46a61575544341403e41ca0a9a424efa942aeb9d 100644 (file)
@@ -173,14 +173,16 @@ main (int argc, char *argv[])
     if (wait_result != 0)
     {
       printf ("Test process exited with result %lu\n", status);
+      TerminateJobObject (job, status);
       exit (status);
     }
     printf ("Test process exited (failed to obtain exit status)\n");
+    TerminateJobObject (job, 0);
     exit (0);
   }
   printf ("Child processes were killed after timeout of %u seconds\n",
              timeout);
-  TerminateJobObject (job, 0);
+  TerminateJobObject (job, 1);
   CloseHandle (proc.hProcess);
   exit (1);
 }