From 99f09dba38ca9dc37c8fe10178d60cc6ee1ce9a3 Mon Sep 17 00:00:00 2001 From: cgf Date: Fri, 15 Mar 2002 21:49:09 +0000 Subject: [PATCH] * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a redirected block should be marked as nonexistent. (winpids::add): Use PID_ALLPIDS when looking for all pids. * cygwin.h (PID_ALLPIDS): New enum element. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/include/sys/cygwin.h | 2 +- winsup/cygwin/net.cc | 6 +++--- winsup/cygwin/pinfo.cc | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 16ea9ce71c..954034d978 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2002-03-15 Christopher Faylor + + * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a + redirected block should be marked as nonexistent. + (winpids::add): Use PID_ALLPIDS when looking for all pids. + * cygwin.h (PID_ALLPIDS): New enum element. + 2002-03-15 Corinna Vinschen * glob.c (stat32_to_STAT): New function. diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index de3b3d4ea9..38e3cb3167 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -94,7 +94,7 @@ enum PID_USETTY = 0x1000, // Setting this enables or disables cygwin's // tty support. This is inherited by // all execed or forked processes. - PID_UNUSED2 = 0x2000, // child has execed + PID_ALLPIDS = 0x2000, // child has execed PID_EXECED = 0x4000, // redirect to original pid info block PID_NOREDIR = 0x8000, // don't redirect if execed PID_EXITED = 0x80000000 // Free entry. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 2008bbe747..17826d6280 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -2456,7 +2456,7 @@ endhostent (void) } /* exported as recvmsg: standards? */ -extern "C" int +extern "C" int cygwin_recvmsg(int s, struct msghdr *msg, int flags) { int ret, nb; @@ -2472,7 +2472,7 @@ cygwin_recvmsg(int s, struct msghdr *msg, int flags) errno = ENOMEM; return -1; } - nb = ret = cygwin_recvfrom (s, buf, tot, flags, + nb = ret = cygwin_recvfrom (s, buf, tot, flags, (struct sockaddr *) msg->msg_name, (int *) &msg->msg_namelen); p = buf; while (nb > 0) { @@ -2509,7 +2509,7 @@ cygwin_sendmsg(int s, const struct msghdr *msg, int flags) memcpy (p, iov[i].iov_base, iov[i].iov_len); p += iov[i].iov_len; } - ret = cygwin_sendto (s, buf, tot, flags, + ret = cygwin_sendto (s, buf, tot, flags, (struct sockaddr *) msg->msg_name, msg->msg_namelen); free (buf); return ret; diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 8e497ef187..4531a8b192 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -183,7 +183,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h) api_fatal ("retrieval of execed process info for pid %d failed due to recursion.", n); n = realpid; release (); - if (flag & PID_NOREDIR) + if (flag & PID_ALLPIDS) { set_errno (ENOENT); break; @@ -287,7 +287,7 @@ winpids::add (DWORD& nelem, bool winpid, DWORD pid) pinfolist = (pinfo *) realloc (pinfolist, size_pinfolist (npidlist + 1)); } - pinfolist[nelem].init (cygpid, PID_NOREDIR); + pinfolist[nelem].init (cygpid, PID_NOREDIR | (winpid ? PID_ALLPIDS : 0)); if (winpid) /* nothing to do */; else if (!pinfolist[nelem]) -- 2.11.0