From b34275c9ab51577aa9b42d0d6f02bd492b04c7f2 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 19 Sep 2003 17:36:04 +0000 Subject: an atexit handler to close a file descriptor? who wrote this crap..; millert ok --- sbin/modunload/modunload.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'sbin/modunload') 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. */ -- cgit v1.2.3