aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2011-08-11 18:59:44 +0200
committerDaniel Lezcano <dlezcano@fr.ibm.com>2011-08-11 18:59:44 +0200
commitd3b904039ce63b4fa0cf94b81247a2825e054cc5 (patch)
tree952b17a0ca3993e630cc39fd1f8a6717539d8b28 /src
parentlxc-ps : update the man page for passing the options (diff)
downloadlxc-d3b904039ce63b4fa0cf94b81247a2825e054cc5.tar.gz
lxc-d3b904039ce63b4fa0cf94b81247a2825e054cc5.tar.bz2
lxc-d3b904039ce63b4fa0cf94b81247a2825e054cc5.zip
fix setns parameter
The setns syscall is now mainstream but the parameter passing changed. Let's fix that. The pid namespace and mount namespace attach are missing for the moment. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/lxc/namespace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c
index 8263fe7..aca29d4 100644
--- a/src/lxc/namespace.c
+++ b/src/lxc/namespace.c
@@ -43,13 +43,13 @@ struct clone_arg {
void *arg;
};
-int setns(int nstype, int fd)
+int setns(int fd, int nstype)
{
#ifndef __NR_setns
errno = ENOSYS;
return -1;
#else
- return syscall(__NR_setns, nstype, fd);
+ return syscall(__NR_setns, fd, nstype);
#endif
}
@@ -106,7 +106,7 @@ int lxc_attach(pid_t pid)
}
for (i = 0; i < size; i++) {
- if (setns(0, fd[i])) {
+ if (setns(fd[i], 0)) {
SYSERROR("failed to set namespace '%s'", ns[i]);
return -1;
}