From: Daniel Lezcano Date: Thu, 11 Aug 2011 16:59:44 +0000 (+0200) Subject: fix setns parameter X-Git-Tag: lxc-0.7.5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3b904039ce63b4fa0cf94b81247a2825e054cc5;p=thirdparty%2Flxc.git 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 --- diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c index 8263fe79a..aca29d4f8 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; }