This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin/cygwin-acl] Fix potential endless loop in pending_signals::clear


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

commit 179415a9d7d473bbba17744abc7769db0f6462e8
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue Nov 3 18:25:23 2015 +0100

    Fix potential endless loop in pending_signals::clear
    
    	* sigproc.cc (pending_signals::clear): Fix previous fix resulting in
    	yet another endless loop.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog  |  5 +++++
 winsup/cygwin/sigproc.cc | 13 ++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index e7dc642..b6e7255 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-03  Corinna Vinschen  <corinna@vinschen.de>
+
+	* sigproc.cc (pending_signals::clear): Fix previous fix resulting in
+	yet another endless loop.
+
 2015-11-02  Corinna Vinschen  <corinna@vinschen.de>
 
 	* include/netinet/ip.h (MAX_IPOPTLEN): Define.
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index fbc738d..6a7708f 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -402,16 +402,11 @@ sig_clear (int sig)
 void
 pending_signals::clear (_cygtls *tls)
 {
-  sigpacket *q = &start, *qnext;
+  sigpacket *q, *qnext;
 
-  while ((qnext = q->next))
-    {
-      if (qnext->sigtls == tls)
-	{
-	  q->next = qnext->next;
-	  qnext->si.si_signo = 0;
-	}
-    }
+  for (q = &start; (qnext = q->next); q->next = qnext->next)
+    if (qnext->sigtls == tls)
+      qnext->si.si_signo = 0;
 }
 
 /* Clear pending signals of specific thread.  Called from _cygtls::remove */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]