GNU bug report logs - #46403
SIGINT ignored when using system*

Previous Next

Package: guile;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Tue, 9 Feb 2021 13:57:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 46403 <at> debbugs.gnu.org
Subject: bug#46403: SIGINT ignored when using system*
Date: Tue, 09 Feb 2021 14:56:06 +0100
I execute commands in a loop and wish to be able to interrupt the loop
with SIGINT.  Here’s the first attempt:

    guile -c \
      '(for-each (lambda (n)
                  (display n)
                  (system* "sleep" "3"))
                 (list 1 2 3 4))'

At no point will this program be interrupted by SIGINT.  Strace reveals
that SIGINT is in fact received and the sleep is interrupted, but the
wait is restarted immediately afterward.

This program on the other hand *can* be interrupted at any point:

    guile -c \
      '(for-each (lambda (n)
                  (if (zero? (primitive-fork))
                   (begin (display n)
                          (execlp "sleep" "sleep" "3"))
                   (waitpid WAIT_ANY)))
                 (list 1 2 3 4))'

Is this by design?

-- 
Ricardo




This bug report was last modified 4 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.