summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/modunload/modunload.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sbin/modunload/modunload.c b/sbin/modunload/modunload.c
index c0e2b9dccf7..7b8b84cc692 100644
--- a/sbin/modunload/modunload.c
+++ b/sbin/modunload/modunload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modunload.c,v 1.13 2003/07/02 21:44:58 deraadt Exp $ */
+/* $OpenBSD: modunload.c,v 1.14 2003/09/19 17:36:03 deraadt Exp $ */
/* $NetBSD: modunload.c,v 1.9 1995/05/28 05:23:05 jtc Exp $ */
/*
@@ -50,8 +50,6 @@
#include "pathnames.h"
-static int devfd;
-
static void
usage(void)
{
@@ -62,16 +60,10 @@ usage(void)
exit(1);
}
-static void
-cleanup(void)
-{
- (void)close(devfd);
-}
-
int
main(int argc, char *argv[])
{
- int c;
+ int c, devfd;
long modnum = -1;
char *modname = NULL;
char *endptr, *post = NULL;
@@ -109,8 +101,6 @@ main(int argc, char *argv[])
if ((devfd = open(_PATH_LKM, O_RDWR, 0)) == -1)
err(2, "%s", _PATH_LKM);
- atexit(cleanup);
-
/*
* Unload the requested module.
*/