Author: mladen.turk(a)jboss.com
Date: 2007-10-06 04:36:58 -0400 (Sat, 06 Oct 2007)
New Revision: 1088
Modified:
trunk/sight/native/os/linux/process.c
Log:
Optimize the term0 code - take2
Modified: trunk/sight/native/os/linux/process.c
===================================================================
--- trunk/sight/native/os/linux/process.c 2007-10-06 08:36:02 UTC (rev 1087)
+++ trunk/sight/native/os/linux/process.c 2007-10-06 08:36:58 UTC (rev 1088)
@@ -554,18 +554,16 @@
SIGHT_EXPORT_DECLARE(jint, Process, term0)(SIGHT_STDARGS, jint pid,
jint signum)
{
- UNREFERENCED_STDARGS;
-
- /* Ensure pid sanity */
- if (pid < 1)
- return APR_EINVAL;
-
#ifndef HAVE_GETPGID
apr_proc_t proc;
apr_status_t rv;
apr_exit_why_e why;
int status;
+ UNREFERENCED_STDARGS;
+ /* Ensure pid sanity */
+ if (pid < 1)
+ return APR_EINVAL;
proc.pid = pid;
rv = apr_proc_wait(&proc, &status, &why, APR_NOWAIT);
@@ -579,6 +577,11 @@
#else
pid_t pg;
+ UNREFERENCED_STDARGS;
+ /* Ensure pid sanity */
+ if (pid < 1)
+ return APR_EINVAL;
+
pg = getpgid(pid);
if (pg == -1) {
/* Process already dead... */