diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-01-18 15:12:45 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-01-18 15:12:45 +0000 |
commit | ed4200c569a44220f2d23ed5f644d91b5f9b5995 (patch) | |
tree | 60bdb5e4606cea46714074ae3f598b9dea2e6284 | |
parent | d92ff3ead36831cc589acee9c97cfa0acae34255 (diff) |
unlink /tmp file on failure too.
-rw-r--r-- | sbin/modload/modload.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/modload/modload.c b/sbin/modload/modload.c index 3551f9219a1..f035506e2a5 100644 --- a/sbin/modload/modload.c +++ b/sbin/modload/modload.c @@ -1,4 +1,4 @@ -/* $OpenBSD: modload.c,v 1.10 1997/01/15 23:41:14 millert Exp $ */ +/* $OpenBSD: modload.c,v 1.11 1997/01/18 15:12:44 mickey Exp $ */ /* $NetBSD: modload.c,v 1.13 1995/05/28 05:21:58 jtc Exp $ */ /* @@ -129,6 +129,7 @@ int fileopen = 0; #define PART_RESRV 0x04 int devfd, modfd; struct lmc_resrv resrv; +char modout[80]; void cleanup() @@ -146,6 +147,9 @@ cleanup() if (fileopen & MOD_OPEN) close(modfd); + + if(dounlink && unlink(modout) != 0) + err(17, "unlink(%s)", modout); } int @@ -159,7 +163,7 @@ main(argc, argv) char *post = NULL; char *out = NULL; char *modobj; - char modout[80], *p; + char *p; struct exec info_buf; struct stat stb; u_int modsize; /* XXX */ @@ -496,8 +500,5 @@ main(argc, argv) err(16, "can't exec `%s'", post); } - if(dounlink && unlink(out) != 0) - err(17, "unlink(%s)", out); - return 0; } |