SOLARIS: Correct ioctl syscall error handling
[openafs.git] / src / sys / glue.c
index 3ba696c..dfcc84a 100644 (file)
@@ -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 */