unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: 46403@debbugs.gnu.org
Subject: bug#46403: SIGINT ignored when using system*
Date: Tue, 09 Feb 2021 14:56:06 +0100	[thread overview]
Message-ID: <87zh0dqr9l.fsf@elephly.net> (raw)

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





             reply	other threads:[~2021-02-09 13:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 13:56 Ricardo Wurmus [this message]
2021-05-01 23:19 ` bug#46403: SIGINT ignored when using system* Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh0dqr9l.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=46403@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).