From: Enrico Scholz Date: Mon, 2 Feb 2004 18:57:33 +0000 (+0000) Subject: fixed vc_new_s_context() to return the context instead of 0/1 X-Git-Tag: VERSION_0_10~808 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e29867baf76f8e0f30cb44c4eb9f34dc72227efe;p=util-vserver.git fixed vc_new_s_context() to return the context instead of 0/1 git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@737 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/lib/syscall-compat.hc b/util-vserver/lib/syscall-compat.hc index 3620ebc..ad384ec 100644 --- a/util-vserver/lib/syscall-compat.hc +++ b/util-vserver/lib/syscall-compat.hc @@ -26,7 +26,7 @@ #include -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; diff --git a/util-vserver/lib/syscall-legacy.hc b/util-vserver/lib/syscall-legacy.hc index 7ba077d..1f3322b 100644 --- a/util-vserver/lib/syscall-legacy.hc +++ b/util-vserver/lib/syscall-legacy.hc @@ -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; } diff --git a/util-vserver/lib/syscall.c b/util-vserver/lib/syscall.c index de3f92e..2c5a8f6 100644 --- a/util-vserver/lib/syscall.c +++ b/util-vserver/lib/syscall.c @@ -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),