Merge pull request #20 from vbatts/vbatts-cleanup_setns

nsenter: fixing the cpp order
This commit is contained in:
Victor Marmol 2014-06-13 11:19:07 -07:00
commit 124aba2f15
1 changed files with 3 additions and 1 deletions

View File

@ -52,14 +52,16 @@ void get_args(int *argc, char ***argv) {
} }
// Use raw setns syscall for versions of glibc that don't include it (namely glibc-2.12) // Use raw setns syscall for versions of glibc that don't include it (namely glibc-2.12)
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 14 && defined(SYS_setns) #if __GLIBC__ == 2 && __GLIBC_MINOR__ < 14
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sched.h> #include <sched.h>
#include "syscall.h" #include "syscall.h"
#ifdef SYS_setns
int setns(int fd, int nstype) { int setns(int fd, int nstype) {
return syscall(SYS_setns, fd, nstype); return syscall(SYS_setns, fd, nstype);
} }
#endif #endif
#endif
void nsenter() { void nsenter() {
int argc; int argc;