Source-Changes-HG archive

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

[src/trunk]: src/bin/pax Set the chflags *after* the rename, not before.



details:   https://anonhg.NetBSD.org/src/rev/381b8fa8611c
branches:  trunk
changeset: 566188:381b8fa8611c
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Apr 30 05:14:23 2004 +0000

description:
Set the chflags *after* the rename, not before.

diffstat:

 bin/pax/file_subs.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 32141db95f2d -r 381b8fa8611c bin/pax/file_subs.c
--- a/bin/pax/file_subs.c       Fri Apr 30 04:12:29 2004 +0000
+++ b/bin/pax/file_subs.c       Fri Apr 30 05:14:23 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file_subs.c,v 1.44 2004/04/27 13:45:45 christos Exp $  */
+/*     $NetBSD: file_subs.c,v 1.45 2004/04/30 05:14:23 matt Exp $      */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)file_subs.c        8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: file_subs.c,v 1.44 2004/04/27 13:45:45 christos Exp $");
+__RCSID("$NetBSD: file_subs.c,v 1.45 2004/04/30 05:14:23 matt Exp $");
 #endif
 #endif /* not lint */
 
@@ -190,11 +190,6 @@
                set_pmode(arcn->tmp_name, arcn->sb.st_mode & FILEBITS(0));
        if (patime || pmtime)
                set_ftime(arcn->tmp_name, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
-#if HAVE_STRUCT_STAT_ST_FLAGS
-       if (pfflags && arcn->type != PAX_SLK)
-               set_chflags(arcn->tmp_name, arcn->sb.st_flags);
-#endif
-
        /*
         * Finally, now the temp file is fully instantiated rename it to
         * the desired file name.
@@ -205,6 +200,11 @@
                (void)unlink(arcn->tmp_name);
        }
 
+#if HAVE_STRUCT_STAT_ST_FLAGS
+       if (pfflags && arcn->type != PAX_SLK)
+               set_chflags(arcn->name, arcn->sb.st_flags);
+#endif
+
        free(arcn->tmp_name);
        arcn->tmp_name = NULL;
        xtmp_name = NULL;



Home | Main Index | Thread Index | Old Index