From: Andrew Deason Date: Fri, 25 Mar 2011 21:37:30 +0000 (-0500) Subject: SOLARIS: Correct ioctl syscall error handling X-Git-Tag: upstream/1.8.0_pre1^2~3998 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=99ed22fb02a3b44c03327a1fdd5ef56e211724b6;p=packages%2Fo%2Fopenafs.git SOLARIS: Correct ioctl syscall error handling Do not use the return code from ioctl for errno. Ioctl itself will set the errno and return value correctly, so don't mess with them. Change-Id: I26c3afb5c77a3fce57e0d53d8671541805b32e08 Reviewed-on: http://gerrit.openafs.org/4345 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear --- diff --git a/src/sys/glue.c b/src/sys/glue.c index 3ba696cb3..dfcc84a6e 100644 --- a/src/sys/glue.c +++ b/src/sys/glue.c @@ -109,7 +109,7 @@ ioctl_sun_afs_syscall(long syscall, uintptr_t param1, uintptr_t param2, { void *ioctldata; long callnum; - int fd, code; + int fd; # ifdef _ILP32 struct afssysargs32 sargs32; @@ -142,16 +142,9 @@ ioctl_sun_afs_syscall(long syscall, uintptr_t param1, uintptr_t param2, return -1; } - *error = 0; - - code = ioctl(fd, callnum, ioctldata); + *error = ioctl(fd, callnum, ioctldata); close(fd); - if (code) { - errno = code; - *error = code; - } - return 0; } #endif /* AFS_SUN511_ENV */