Merge pull request #300 from dqminh/subreaper

define PR_SET_CHILD_SUBREAPER if not set
This commit is contained in:
Mrunal Patel 2014-12-19 10:44:23 -08:00
commit 08fdb50b03
1 changed files with 11 additions and 6 deletions

View File

@ -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);
}