Merge pull request #300 from dqminh/subreaper
define PR_SET_CHILD_SUBREAPER if not set
This commit is contained in:
commit
08fdb50b03
|
@ -15,6 +15,10 @@
|
|||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#ifndef PR_SET_CHILD_SUBREAPER
|
||||
#define PR_SET_CHILD_SUBREAPER 36
|
||||
#endif
|
||||
|
||||
static const kBufSize = 256;
|
||||
static const char *kNsEnter = "nsenter";
|
||||
|
||||
|
@ -90,7 +94,8 @@ void nsenter()
|
|||
}
|
||||
|
||||
if (prctl(PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0) == -1) {
|
||||
fprintf(stderr, "nsenter: failed to set child subreaper: %s", strerror(errno));
|
||||
fprintf(stderr, "nsenter: failed to set child subreaper: %s",
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue