From dd1db5cb43f11745170f4353b28819ab9698cd8c Mon Sep 17 00:00:00 2001 From: David McFarland Date: Thu, 13 Aug 2020 18:05:14 +0000 Subject: [PATCH] chrootenv: ignore SIGINT while waiting for child This allows child processes (e.g. gdb) to be use ctrl-c in a chrootenv without chrootenv being terminated. --- .../build-support/build-fhsenv-chroot/chrootenv/src/chrootenv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/build-fhsenv-chroot/chrootenv/src/chrootenv.c b/pkgs/build-support/build-fhsenv-chroot/chrootenv/src/chrootenv.c index c109d7297e174..79a92a6edd25b 100644 --- a/pkgs/build-support/build-fhsenv-chroot/chrootenv/src/chrootenv.c +++ b/pkgs/build-support/build-fhsenv-chroot/chrootenv/src/chrootenv.c @@ -155,6 +155,8 @@ int main(gint argc, gchar **argv) { else { int status; + fail_if(signal(SIGINT, SIG_IGN) == SIG_ERR); + fail_if(waitpid(cpid, &status, 0) != cpid); fail_if(rmdir(prefix));