diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-11-03 18:25:23 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-11-03 18:25:23 +0100 |
commit | 0ed1523470ba33a2afba1510a19e51c4af9e329a (patch) | |
tree | 4ea598d5b6f502dedf0e6568ca99b759fc07e1fc /winsup | |
parent | 0a4019eed22c1d84a87dd39370e56db2f19fe35a (diff) | |
download | newlib-0ed1523470ba33a2afba1510a19e51c4af9e329a.zip newlib-0ed1523470ba33a2afba1510a19e51c4af9e329a.tar.gz newlib-0ed1523470ba33a2afba1510a19e51c4af9e329a.tar.bz2 |
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>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.cc | 13 |
2 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index dfeaf39..b990d9f 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 */ |