mirror of https://github.com/mkerrisk/man-pages
setns.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
9edaeefb96
commit
e2b63503b8
|
@ -284,14 +284,14 @@ main(int argc, char *argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fd = open(argv[1], O_RDONLY); /* Get file descriptor for namespace */
|
||||
fd = open(argv[1], O_RDONLY); /* Get file descriptor for namespace */
|
||||
if (fd == \-1)
|
||||
errExit("open");
|
||||
|
||||
if (setns(fd, 0) == \-1) /* Join that namespace */
|
||||
if (setns(fd, 0) == \-1) /* Join that namespace */
|
||||
errExit("setns");
|
||||
|
||||
execvp(argv[2], &argv[2]); /* Execute a command in namespace */
|
||||
execvp(argv[2], &argv[2]); /* Execute a command in namespace */
|
||||
errExit("execvp");
|
||||
}
|
||||
.EE
|
||||
|
|
Loading…
Reference in New Issue