Author: mladen.turk(a)jboss.com
Date: 2007-10-06 04:41:59 -0400 (Sat, 06 Oct 2007)
New Revision: 1090
Modified:
trunk/sight/native/os/linux/process.c
Log:
Optimize the term0 code -detect pid sanity
Modified: trunk/sight/native/os/linux/process.c
===================================================================
--- trunk/sight/native/os/linux/process.c 2007-10-06 08:39:16 UTC (rev 1089)
+++ trunk/sight/native/os/linux/process.c 2007-10-06 08:41:59 UTC (rev 1090)
@@ -563,6 +563,10 @@
pid_t pg;
#endif
+ /* Ensure pid sanity */
+ if (pid < 1)
+ return APR_EINVAL;
+
#ifndef HAVE_GETPGID
proc.pid = pid;
rv = apr_proc_wait(&proc, &status, &why, APR_NOWAIT);