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 <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Andrew Deason 2010-12-09 13:02:16 -06:00 committed by Derrick Brashear
parent f46bba8611
commit 9da7f3cc73

View 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