Index: fork.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fork.cc,v retrieving revision 1.175 diff -u -p -r1.175 fork.cc --- fork.cc 29 Dec 2005 20:46:34 -0000 1.175 +++ fork.cc 18 May 2006 03:54:26 -0000 @@ -320,11 +320,15 @@ frok::parent (void *stack_here) if (!child) { + int e = get_errno(); this_errno = get_errno () == ENOMEM ? ENOMEM : EAGAIN; #ifdef DEBUGGING - error = "pinfo failed"; + static char buf[4096]; + int w = geterrno_from_win_error(); + snprintf(buf, 4095, "pinfo failed: %d, %d", e, w); + error = buf; #else - syscall_printf ("pinfo failed"); + syscall_printf ("pinfo failed: %d, %E", e); #endif goto cleanup; } Index: pinfo.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/pinfo.cc,v retrieving revision 1.225 diff -u -p -r1.225 pinfo.cc --- pinfo.cc 11 Feb 2006 04:53:14 -0000 1.225 +++ pinfo.cc 18 May 2006 03:54:27 -0000 @@ -259,6 +259,61 @@ pinfo::init (pid_t n, DWORD flag, HANDLE locking mechanism, just loop. */ if (!created && createit && (procinfo->process_state & PID_EXITED)) { + if (i == 0) { + system_printf("procinfo = { pid=%d, process_state=%x, exitcode=%u, " + "cygstarted=%d, ppid=%d, dwProcessId=%u, " + "progname='%s', uid=%d, gid=%d, pgid=%d, sid=%d, " + "ctty=%d, has_pgid_children=%d, start_time=%lu, " + "rusage_self={(%ld,%ld),(%ld,%ld),%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld}, " + "rusage_children={(%ld,%ld),(%ld,%ld),%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld}, " + "nice=%d, stopsig=%d }", + procinfo->pid, procinfo->process_state, + procinfo->exitcode, procinfo->cygstarted, + procinfo->ppid, procinfo->dwProcessId, + procinfo->progname, procinfo->uid, procinfo->gid, + procinfo->pgid, procinfo->sid, procinfo->ctty, + procinfo->has_pgid_children, procinfo->start_time, + procinfo->rusage_self.ru_utime.tv_sec, + procinfo->rusage_self.ru_utime.tv_usec, + procinfo->rusage_self.ru_stime.tv_sec, + procinfo->rusage_self.ru_stime.tv_usec, + procinfo->rusage_self.ru_maxrss, + procinfo->rusage_self.ru_ixrss, + procinfo->rusage_self.ru_idrss, + procinfo->rusage_self.ru_isrss, + procinfo->rusage_self.ru_minflt, + procinfo->rusage_self.ru_majflt, + procinfo->rusage_self.ru_nswap, + procinfo->rusage_self.ru_inblock, + procinfo->rusage_self.ru_oublock, + procinfo->rusage_self.ru_msgsnd, + procinfo->rusage_self.ru_msgrcv, + procinfo->rusage_self.ru_nsignals, + procinfo->rusage_self.ru_nvcsw, + procinfo->rusage_self.ru_nivcsw, + procinfo->rusage_children.ru_utime.tv_sec, + procinfo->rusage_children.ru_utime.tv_usec, + procinfo->rusage_children.ru_stime.tv_sec, + procinfo->rusage_children.ru_stime.tv_usec, + procinfo->rusage_children.ru_maxrss, + procinfo->rusage_children.ru_ixrss, + procinfo->rusage_children.ru_idrss, + procinfo->rusage_children.ru_isrss, + procinfo->rusage_children.ru_minflt, + procinfo->rusage_children.ru_majflt, + procinfo->rusage_children.ru_nswap, + procinfo->rusage_children.ru_inblock, + procinfo->rusage_children.ru_oublock, + procinfo->rusage_children.ru_msgsnd, + procinfo->rusage_children.ru_msgrcv, + procinfo->rusage_children.ru_nsignals, + procinfo->rusage_children.ru_nvcsw, + procinfo->rusage_children.ru_nivcsw, + procinfo->nice, (int)procinfo->stopsig); + system_printf("looping because pid %d, procinfo->pid %d, " + "procinfo->dwProcessid %u has PID_EXITED set", + n, procinfo->pid, procinfo->dwProcessId); + } debug_printf ("looping because pid %d, procinfo->pid %d, " "procinfo->dwProcessid %u has PID_EXITED set", n, procinfo->pid, procinfo->dwProcessId);