]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DARWIN: Fix setpag syscall error detection
authorAndrew Deason <adeason@sinenomine.net>
Thu, 9 Dec 2010 19:02:16 +0000 (13:02 -0600)
committerDerrick Brashear <shadow@dementia.org>
Mon, 13 Dec 2010 23:52:33 +0000 (15:52 -0800)
Darwin uses the same variable as the return value for
ioctl_afs_syscall, and as the last 'out' parmater, so the return value
for ioctl_afs_syscall will always overwrite whatever is written to the
last 'out' parameter. Instead, record two different variables, and
allow the returned error to overridte the error set as the last
parameter.

Reviewed-on: http://gerrit.openafs.org/3497
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9da7f3cc73bf990427a9dd80ba2bbbb618383ea3)

Change-Id: I440d33e5cdd94dc5c7d12ddef1e63a05e53d787d
Reviewed-on: http://gerrit.openafs.org/3508
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/sys/setpag.c

index 169dafa9836625753c972fd8edd75775b927bcd4..8a36af5291caa7608edfd071f7b6700217b634c5 100644 (file)
@@ -57,7 +57,12 @@ lsetpag(void)
     if(rval)
       errcode = syscall(AFS_SYSCALL, AFSCALL_SETPAG);
 #elif defined(AFS_DARWIN80_ENV)
-    errcode = ioctl_afs_syscall(AFSCALL_SETPAG,0,0,0,0,0,0,&errcode);
+    int rval;
+
+    rval = ioctl_afs_syscall(AFSCALL_SETPAG,0,0,0,0,0,0,&errcode);
+    if (rval) {
+       errorcode = rval;
+    }
 #else
     errcode = syscall(AFS_SYSCALL, AFSCALL_SETPAG);
 #endif