setns.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-11-09 11:27:14 +01:00
parent 9edaeefb96
commit e2b63503b8
1 changed files with 3 additions and 3 deletions

View File

@ -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