From: Andrew Deason Date: Thu, 9 Dec 2010 19:02:16 +0000 (-0600) Subject: DARWIN: Fix setpag syscall error detection X-Git-Tag: upstream/1.8.0_pre1^2~4373 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=9da7f3cc73bf990427a9dd80ba2bbbb618383ea3;p=packages%2Fo%2Fopenafs.git DARWIN: Fix setpag syscall error detection 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. Change-Id: I7db1b226612c55c892810ce446b486b7e503529c Reviewed-on: http://gerrit.openafs.org/3497 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/sys/setpag.c b/src/sys/setpag.c index 169dafa98..8a36af529 100644 --- a/src/sys/setpag.c +++ b/src/sys/setpag.c @@ -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