From 99ed22fb02a3b44c03327a1fdd5ef56e211724b6 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 25 Mar 2011 16:37:30 -0500 Subject: [PATCH] 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 --- src/sys/glue.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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 */ -- 2.39.5