fixed vc_new_s_context() to return the context instead of 0/1
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 2 Feb 2004 18:57:33 +0000 (18:57 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 2 Feb 2004 18:57:33 +0000 (18:57 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@737 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/syscall-compat.hc
util-vserver/lib/syscall-legacy.hc
util-vserver/lib/syscall.c

index 3620ebc..ad384ec 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <unistd.h>
 
-static inline ALWAYSINLINE int
+static inline ALWAYSINLINE xid_t
 vc_new_s_context_compat(xid_t ctx, unsigned int remove_cap, unsigned int flags)
 {
   struct vcmd_new_s_context_v1 msg;
index 7ba077d..1f3322b 100644 (file)
@@ -93,7 +93,7 @@ static int __NR_new_s_context_rev0;
 static int rev_s_context=0;
 
 #if defined(__pic__) && defined(__i386)
-inline static int
+inline static xid_t
 new_s_context_rev0(int newctx, int remove_cap, int flags)
 {
   return syscall(__NR_new_s_context_rev0, newctx, remove_cap, flags);
@@ -205,16 +205,16 @@ void vc_init_internal_legacy(int ctx_rev, int ctx_number,
   is_init = true;
 }
 
-static ALWAYSINLINE int
+static ALWAYSINLINE xid_t
 vc_new_s_context_legacy(int ctx, int remove_cap, int flags)
 {
-       int ret = -1;
+        xid_t ret = -1;
        init();
        if (rev_s_context == 0){
                return new_s_context_rev0(ctx, remove_cap, flags);
        }else{
                errno = -ENOSYS;
-               ret   = -1;
+               ret   = VC_NOCTX;
        }
        return ret;
 }
index de3f92e..2c5a8f6 100644 (file)
@@ -47,7 +47,7 @@
 
 #if defined(VC_ENABLE_API_COMPAT) || defined(VC_ENABLE_API_LEGACY)
 
-int
+xid_t
 vc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags)
 {
   CALL_VC(CALL_VC_COMPAT(vc_new_s_context, ctx, remove_cap, flags),