apply patches in PR bin/9249: rdist doesn't remove temporary file, from

<Michael.Eriksson@era-t.ericsson.se> to ensure we always remove the tempfile
(broken since mkstemp() was introduced).
This commit is contained in:
mrg 2000-06-12 04:43:11 +00:00
parent 814b7243b2
commit de9e599c9d
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: docmd.c,v 1.19 1999/04/20 07:53:02 mrg Exp $ */
/* $NetBSD: docmd.c,v 1.20 2000/06/12 04:43:11 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)docmd.c 8.1 (Berkeley) 6/9/93";
#else
__RCSID("$NetBSD: docmd.c,v 1.19 1999/04/20 07:53:02 mrg Exp $");
__RCSID("$NetBSD: docmd.c,v 1.20 2000/06/12 04:43:11 mrg Exp $");
#endif
#endif /* not lint */
@ -203,7 +203,6 @@ done:
if (sc->sc_type == NOTIFY)
notify(tempfile, rhost, sc->sc_args, 0);
if (!nflag) {
(void) unlink(tempfile);
for (; ihead != NULL; ihead = ihead->nextp) {
free(ihead);
if ((opts & IGNLNKS) || ihead->count == 0)
@ -439,8 +438,6 @@ dodcolon(filev, files, stamp, cmds)
for (sc = cmds; sc != NULL; sc = sc->sc_next)
if (sc->sc_type == NOTIFY)
notify(tempfile, NULL, sc->sc_args, lastmod);
if (!nflag && !(options & VERIFY))
(void) unlink(tempfile);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.10 1999/04/20 07:53:02 mrg Exp $ */
/* $NetBSD: main.c,v 1.11 2000/06/12 04:43:11 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/9/93";
#else
__RCSID("$NetBSD: main.c,v 1.10 1999/04/20 07:53:02 mrg Exp $");
__RCSID("$NetBSD: main.c,v 1.11 2000/06/12 04:43:11 mrg Exp $");
#endif
#endif /* not lint */
@ -212,6 +212,7 @@ main(argc, argv)
if (iamremote) {
server();
unlink(tempfile);
exit(nerrs != 0);
}
@ -226,6 +227,7 @@ main(argc, argv)
fin = fopen(distfile, "r");
if (fin == NULL) {
perror(distfile ? distfile : "distfile");
unlink(tempfile);
exit(1);
}
}
@ -234,6 +236,7 @@ main(argc, argv)
docmds(dhosts, argc, argv);
}
unlink(tempfile);
exit(nerrs != 0);
}
@ -282,7 +285,7 @@ docmdargs(nargs, args)
tnl.n_name = cp;
hosts = expand(&tnl, E_ALL);
if (nerrs)
exit(1);
return;
if (dest == NULL || *dest == '\0')
cmds = NULL;