From: Denys Vlasenko Date: Fri, 20 Mar 2009 13:28:00 +0000 (+0000) Subject: As it turned out, "if (interrupted) break;" is needed in both loops, X-Git-Tag: v4.5.19~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e209212163c84290990e1c5e75200c733ba0bf2;p=strace As it turned out, "if (interrupted) break;" is needed in both loops, 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. --- diff --git a/strace.c b/strace.c index e275bfd1..853288dc 100644 --- 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;