From 722b0f60ca48b7ab27194c3416dc0922b893e5dd Mon Sep 17 00:00:00 2001 From: mickey Date: Sat, 18 Jan 1997 15:12:44 +0000 Subject: [PATCH] unlink /tmp file on failure too. --- sbin/modload/modload.c | 11 ++++++----- 1 file 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; } -- 2.20.1