From 71d51cae1f71df1b597792e847acabbf50fab058 Mon Sep 17 00:00:00 2001 From: Christopher Allen Wing Date: Thu, 15 May 2003 16:16:45 +0000 Subject: [PATCH] STABLE12-setgroups-return-errors-negative-20030515 FIXES 1383 return errors negative as linux kernel needs (cherry picked from commit 3c66862d6932430e64e7abbd8c87fffd47b5e2cd) --- src/afs/LINUX/osi_groups.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index c204299a9..3c6947237 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -137,7 +137,8 @@ asmlinkage long afs_xsetgroups(int gidsetsize, gid_t *grouplist) crfree(cr); unlock_kernel(); - return code; + /* Linux syscall ABI returns errno as negative */ + return (- code); } #if defined(AFS_LINUX24_ENV) @@ -169,7 +170,8 @@ asmlinkage int afs_xsetgroups32(int gidsetsize, gid_t *grouplist) crfree(cr); unlock_kernel(); - return code; + /* Linux syscall ABI returns errno as negative */ + return (- code); } #endif @@ -202,7 +204,8 @@ asmlinkage int afs32_xsetgroups(int gidsetsize, __kernel_gid_t32 *grouplist) crfree(cr); unlock_kernel(); - return code; + /* Linux syscall ABI returns errno as negative */ + return (- code); } #ifdef AFS_LINUX24_ENV /* Intercept the uid32 system call as used by 32bit programs. */ @@ -233,7 +236,8 @@ asmlinkage int afs32_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist) crfree(cr); unlock_kernel(); - return code; + /* Linux syscall ABI returns errno as negative */ + return (- code); } #endif #endif -- 2.39.5