]> granicus.if.org Git - strace/commitdiff
As it turned out, "if (interrupted) break;" is needed in both loops,
authorDenys Vlasenko <dvlasenk@redhat.com>
Fri, 20 Mar 2009 13:28:00 +0000 (13:28 +0000)
committerDenys Vlasenko <dvlasenk@redhat.com>
Fri, 20 Mar 2009 13:28:00 +0000 (13:28 +0000)
in "collect tasks" loop and in enclosing "collect/process" loop.
Before this patch, "strace cat" + "killall -INT strace" wasn't
making strace stop and exit. This patch restores 4.5.18 behavior
in this regard.

strace.c

index e275bfd12acb7fa90bd04d395762b4f5a9e59d81..853288dc14593394227e116557b2168fcede8eb3 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2789,6 +2789,8 @@ trace()
                 * To fix it, we collect *all* waitable tasks, then handle
                 * them all, then repeat.
                 */
+               if (interrupted)
+                       return 0;
                tcbs = collect_stopped_tcbs();
                if (!tcbs)
                        break;