--- /usr/tmp/TmpDir.12392-0/src/pmie/src/dstruct.c_1.2 Thu Jan 2 20:48:48 2003 +++ src/pmie/src/dstruct.c Thu Jan 2 15:36:33 2003 @@ -5,7 +5,7 @@ * Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved. */ -#ident "$Id: dstruct.c,v 1.2 2002/07/06 05:48:20 kenmcd Exp $" +#ident "$Id: dstruct.c,v 1.1 2000/12/05 03:42:25 max Exp $" #include #include @@ -164,10 +164,24 @@ { RealTime curr; /* current time */ long delay; /* interval to sleep */ - int status; + int sts; + pid_t pid; + /* harvest terminated children */ - while (waitpid(-1, &status, WNOHANG) > (pid_t)0); + while ((pid = waitpid(-1, &sts, WNOHANG)) > (pid_t)0) { +#if PCP_DEBUG + if (pmDebug & DBG_TRACE_APPL2) { + fprintf(stderr, "sleepTight: wait: pid=%d done status=0x%x", pid, sts); + if (WIFEXITED(sts)) + fprintf(stderr, " exit=%d", WEXITSTATUS(sts)); + if (WIFSIGNALED(sts)) + fprintf(stderr, " signal=%d", WTERMSIG(sts)); + fprintf(stderr, " (wait returns %d)\n", pid); + } +#endif + ; + } if (archives) return;