summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-09-19 17:36:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-09-19 17:36:04 +0000
commitb34275c9ab51577aa9b42d0d6f02bd492b04c7f2 (patch)
treeb9c2aa89d92099c432720a924c79aa822376bb8c
parent485e7621640949600c37f79f9ae249e2a1030e4f (diff)
an atexit handler to close a file descriptor? who wrote this crap..; millert ok
-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.
*/