ukernel: handle pioctl errors properly in ktc
authorDerrick Brashear <shadow@dementix.org>
Fri, 4 Nov 2011 15:43:01 +0000 (11:43 -0400)
committerDerrick Brashear <shadow@dementix.org>
Sat, 5 Nov 2011 17:44:17 +0000 (10:44 -0700)
the straight return from call_syscall isn't what we want. munge so
e.g. EDOM handling for ktc_GetToken does the right thing.

Change-Id: I3fbba799e0156bad29b27c74a1c7709ee8c50c34
Reviewed-on: http://gerrit.openafs.org/5807
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/auth/ktc.c

index 138a844..511c42b 100644 (file)
@@ -124,7 +124,7 @@ static void ktc_LocalCell(void);
 #ifdef AFS_DUX40_ENV
 #define PIOCTL afs_pioctl
 #elif defined(UKERNEL)
-#define PIOCTL(A,B,C,D) call_syscall(AFSCALL_PIOCTL,A,B,C,D)
+#define PIOCTL(A,B,C,D) (errno = (call_syscall(AFSCALL_PIOCTL,A,B,C,D)), errno?-1:0)
 #else
 #define PIOCTL pioctl
 #endif