NULL
};
+static void
+reset_sysent(void)
+{
+ if (afs_sinited) {
+ sysent[SYS_setgroups].sy_callc = afs_orig_setgroups;
+ sysent[SYS_ioctl].sy_call = afs_orig_ioctl;
+#if defined(AFS_SUN57_64BIT_ENV)
+ sysent32[SYS_setgroups].sy_callc = afs_orig_setgroups32;
+ sysent32[SYS_ioctl].sy_call = afs_orig_ioctl32;
+#endif
+ }
+}
+
/** This is the function that modload calls when loading the afs kernel
* extensions. The solaris modload program searches for the _init
* function in a module and calls it when modloading
osi_Init(); /* initialize global lock, etc */
code = mod_install(&afs_modlinkage);
+ if (code) {
+ /* we failed to load, so make sure we don't leave behind any
+ * references to our syscall handlers */
+ reset_sysent();
+ }
return code;
}
if (afs_globalVFS)
return EBUSY;
- if (afs_sinited) {
- sysent[SYS_setgroups].sy_callc = afs_orig_setgroups;
- sysent[SYS_ioctl].sy_call = afs_orig_ioctl;
-#if defined(AFS_SUN57_64BIT_ENV)
- sysent32[SYS_setgroups].sy_callc = afs_orig_setgroups32;
- sysent32[SYS_ioctl].sy_call = afs_orig_ioctl32;
-#endif
- }
+ reset_sysent();
code = mod_remove(&afs_modlinkage);
return code;
}