[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/27: Use PR_SET_PDEATHSIG to ensure child cleanup
From: |
Ludovic Courtès |
Subject: |
02/27: Use PR_SET_PDEATHSIG to ensure child cleanup |
Date: |
Wed, 03 Jun 2015 22:00:32 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 1f8456ff13dadb96c8540df240505a2d01a22f6c
Author: Eelco Dolstra <address@hidden>
Date: Thu Aug 21 15:31:43 2014 +0200
Use PR_SET_PDEATHSIG to ensure child cleanup
---
nix/libutil/util.cc | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index a4a1ddb..9bb6ba3 100644
--- a/nix/libutil/util.cc
+++ b/nix/libutil/util.cc
@@ -19,6 +19,10 @@
#include <sys/syscall.h>
#endif
+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
+
extern char * * environ;
@@ -867,6 +871,10 @@ pid_t startProcess(std::function<void()> fun,
if (pid == 0) {
_writeToStderr = 0;
try {
+#if __linux__
+ if (dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1)
+ throw SysError("setting death signal");
+#endif
restoreAffinity();
fun();
} catch (std::exception & e) {
- branch nix updated (3bfa70b -> e531520), Ludovic Courtès, 2015/06/03
- 01/27: Rename 'initChild' to 'runChild'., Ludovic Courtès, 2015/06/03
- 02/27: Use PR_SET_PDEATHSIG to ensure child cleanup,
Ludovic Courtès <=
- 04/27: Get rid of unnecessary "interrupted by the user" message with -vvv, Ludovic Courtès, 2015/06/03
- 03/27: Remove tabs, Ludovic Courtès, 2015/06/03
- 07/27: Shut up a Valgrind warning, Ludovic Courtès, 2015/06/03
- 06/27: Fix some memory leaks, Ludovic Courtès, 2015/06/03
- 08/27: Silence some warnings on GCC 4.9, Ludovic Courtès, 2015/06/03
- 09/27: Better error message, Ludovic Courtès, 2015/06/03
- 10/27: Explicitly include required C headers, Ludovic Courtès, 2015/06/03
- 05/27: Ensure we're writing to stderr in the builder, Ludovic Courtès, 2015/06/03
- 12/27: libutil: Improve errmsg on readLink size mismatch., Ludovic Courtès, 2015/06/03
- 13/27: libutil: Limit readLink() error to only overflows., Ludovic Courtès, 2015/06/03