]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Ignore SIGSYS when issuing pioctl syscall
authorAndrew Deason <adeason@sinenomine.net>
Tue, 14 Jul 2009 16:29:01 +0000 (11:29 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 10 Aug 2009 03:26:46 +0000 (20:26 -0700)
Ignore SIGSYS when we issue the pioctl syscall, so we don't dump core
when the kernel module hasn't yet been installed on several platforms.
Also, restore the old SIGSYS signal handler afterwards, so we don't
cause any side-effects.

Reviewed-on: http://gerrit.openafs.org/81
Verified-by: Andrew Deason <adeason@sinenomine.net>
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
(cherry picked from commit 4f36dd089a9c7187f94f77516a486245c057f7f4)
Reviewed-on: http://gerrit.openafs.org/274
Tested-by: Andrew Deason <adeason@sinenomine.net>
src/sys/afssyscalls.c

index 24c38f0b9b0f93aa132f0589bc04ea65c189bb74..68f0f3cfc0eec3e36eb3c1b30efd3446121ce983 100644 (file)
@@ -350,7 +350,13 @@ lpioctl(char *path, int cmd, char *cmarg, int follow)
     if (rval)
        errcode = rval;
 #else
+    /* As kauth/user.c says, handle smoothly the case where no AFS system call
+     * exists (yet). */
+    void (*old)() = signal(SIGSYS, SIG_IGN);
+
     errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, follow);
+
+    signal(SIGSYS, old);
 #endif
 
     return (errcode);