Merge pull request #530 from hqhq/hq_add_nsexec_comment
add comments for nsexec.c
This commit is contained in:
commit
2afcf7c77c
|
@ -137,6 +137,8 @@ void nsexec()
|
|||
}
|
||||
|
||||
if (setjmp(env) == 1) {
|
||||
// Child
|
||||
|
||||
if (setsid() == -1) {
|
||||
pr_perror("setsid failed");
|
||||
exit(1);
|
||||
|
@ -162,7 +164,11 @@ void nsexec()
|
|||
// Finish executing, let the Go runtime take over.
|
||||
return;
|
||||
}
|
||||
// Parent
|
||||
|
||||
// We must fork to actually enter the PID namespace, use CLONE_PARENT
|
||||
// so the child can have the right parent, and we don't need to forward
|
||||
// the child's exit code or resend its death signal.
|
||||
child = clone_parent(&env);
|
||||
if (child < 0) {
|
||||
pr_perror("Unable to fork");
|
||||
|
|
Loading…
Reference in New Issue