break out special local mail processing (e.g., mapping to the
[unix-history] / usr / src / usr.bin / xinstall / xinstall.c
index 2d3fa24..5c08ba5 100644 (file)
@@ -1,18 +1,18 @@
 /*
 /*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1987, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1987 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1987, 1993\n\
      The Regents of the University of California.  All rights reserved.\n";
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)xinstall.c 5.32 (Berkeley) %G%";
+static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -126,9 +126,10 @@ main(argc, argv)
                 * off the append/immutable bits -- if we fail, go ahead,
                 * it might work.
                 */
                 * off the append/immutable bits -- if we fail, go ahead,
                 * it might work.
                 */
-               if (to_sb.st_flags & (UF_IMMUTABLE | UF_APPEND))
+#define        NOCHANGEBITS    (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)
+               if (to_sb.st_flags & NOCHANGEBITS)
                        (void)chflags(to_name,
                        (void)chflags(to_name,
-                           to_sb.st_flags & ~(UF_APPEND | UF_IMMUTABLE));
+                           to_sb.st_flags & ~(NOCHANGEBITS));
                (void)unlink(to_name);
        }
        install(*argv, to_name, fset, iflags);
                (void)unlink(to_name);
        }
        install(*argv, to_name, fset, iflags);
@@ -173,8 +174,9 @@ install(from_name, to_name, fset, flags)
         * off the append/immutable bits -- if we fail, go ahead,
         * it might work.
         */
         * off the append/immutable bits -- if we fail, go ahead,
         * it might work.
         */
-       if (stat(to_name, &to_sb) == 0 && to_sb.st_flags & (UF_APPEND | UF_IMMUTABLE))
-               (void)chflags(to_name, to_sb.st_flags & ~(UF_APPEND | UF_IMMUTABLE));
+       if (stat(to_name, &to_sb) == 0 &&
+           to_sb.st_flags & (NOCHANGEBITS))
+               (void)chflags(to_name, to_sb.st_flags & ~(NOCHANGEBITS));
        (void)unlink(to_name);
 
        /* Create target. */
        (void)unlink(to_name);
 
        /* Create target. */