Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xinstall Don't unlink the file first if we are renam...



details:   https://anonhg.NetBSD.org/src/rev/31b34e342abb
branches:  trunk
changeset: 467422:31b34e342abb
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 24 15:13:46 1999 +0000

description:
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.

diffstat:

 usr.bin/xinstall/xinstall.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1d146a89c02f -r 31b34e342abb usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Wed Mar 24 14:12:52 1999 +0000
+++ b/usr.bin/xinstall/xinstall.c       Wed Mar 24 15:13:46 1999 +0000
@@ -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 @@
 #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 @@
                            to_sb.st_flags & ~(NOCHANGEBITS));
                if (dobackup)
                        backup(to_name);
-               else
+               else if (!dorename)
                        (void)unlink(to_name);
        }
        install(*argv, to_name, fset, iflags);



Home | Main Index | Thread Index | Old Index