Don't unlink the file first if we are renaming. We want to be as atomic as

possible, and this not only introduces time where the file is not valid,
but also breaks in the ld.so install where strip does not find ld.so, since
it has not been renamed yet.
This commit is contained in:
christos 1999-03-24 15:13:46 +00:00
parent fdd6c4d819
commit a33a2c20ff
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: xinstall.c,v 1.33 1999/02/04 11:56:48 christos Exp $ */
/* $NetBSD: xinstall.c,v 1.34 1999/03/24 15:13:46 christos Exp $ */
/*
* Copyright (c) 1987, 1993
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
#if 0
static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#else
__RCSID("$NetBSD: xinstall.c,v 1.33 1999/02/04 11:56:48 christos Exp $");
__RCSID("$NetBSD: xinstall.c,v 1.34 1999/03/24 15:13:46 christos Exp $");
#endif
#endif /* not lint */
@ -248,7 +248,7 @@ main(argc, argv)
to_sb.st_flags & ~(NOCHANGEBITS));
if (dobackup)
backup(to_name);
else
else if (!dorename)
(void)unlink(to_name);
}
install(*argv, to_name, fset, iflags);