- 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));