[newlib-cygwin] Avoid delays trying to fetch Cygwin info from non-Cygwin processes

Corinna Vinschen corinna@sourceware.org
Mon Jun 8 12:38:00 GMT 2015


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=95868172f39e972dbcfad3e69fee7854eafe20dd

commit 95868172f39e972dbcfad3e69fee7854eafe20dd
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Jun 8 14:38:30 2015 +0200

    Avoid delays trying to fetch Cygwin info from non-Cygwin processes
    
    	* pinfo.cc (_pinfo::commune_request): Don't try to send commune
    	requests to non-Cygwin processes.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog     |  5 +++++
 winsup/cygwin/pinfo.cc      |  7 ++++++-
 winsup/cygwin/release/2.0.4 | 11 +++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 894094c..c399935 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-08  Corinna Vinschen  <corinna@vinschen.de>
+
+	* pinfo.cc (_pinfo::commune_request): Don't try to send commune
+	requests to non-Cygwin processes.
+
 2015-06-08  Takashi Yano  <takashi.yano@nifty.ne.jp>
 
 	* fhandler_tty.cc (fhandler_pty_slave::write): Move causing of SIGHUP
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 4518d6d..4bebbbc 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -1,7 +1,7 @@
 /* pinfo.cc: process table support
 
    Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
+   2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -690,6 +690,11 @@ _pinfo::commune_request (__uint32_t code, ...)
       set_errno (ESRCH);
       goto err;
     }
+  if (ISSTATE (this, PID_NOTCYGWIN))
+    {
+      set_errno (ENOTSUP);
+      goto err;
+    }
 
   va_start (args, code);
   si._si_commune._si_code = code;
diff --git a/winsup/cygwin/release/2.0.4 b/winsup/cygwin/release/2.0.4
new file mode 100644
index 0000000..c60cdd9
--- /dev/null
+++ b/winsup/cygwin/release/2.0.4
@@ -0,0 +1,11 @@
+Bug Fixes
+---------
+
+- Handle SIGHUP in pty master close.
+  Addresses: https://cygwin.com/ml/cygwin/2015-06/msg00133.html
+	     https://cygwin.com/ml/cygwin/2011-07/msg00295.html
+
+- Avoid fetching /proc process info from non-Cygwin processes.
+  Addresses: https://cygwin.com/ml/cygwin/2015-06/msg00133.html
+	     https://cygwin.com/ml/cygwin/2015-05/msg00331.html
+	     https://cygwin.com/ml/cygwin/2015-05/msg00314.html



More information about the Cygwin-cvs mailing list