From: Eitan Adler Date: Fri, 26 Apr 2013 17:57:15 +0000 (-0400) Subject: rm(1): Some minor style and bug fixes from FreeBSD X-Git-Tag: v3.7.0~1166 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/f61b40892c86103bc40695735428d9597c390d1a rm(1): Some minor style and bug fixes from FreeBSD --- diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 9b1588b372..78a105da46 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -52,7 +52,7 @@ static int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; static int rflag, Iflag, xflag; static uid_t uid; -volatile sig_atomic_t info; +static volatile sig_atomic_t info; static int check(const char *, const char *, struct stat *); static int check2(char **); @@ -203,7 +203,7 @@ rm_tree(char **argv) if ((fts = fts_open(argv, flags, NULL)) == NULL) { if (fflag && errno == ENOENT) return; - err(1, NULL); + err(1, "fts_open"); } while ((p = fts_read(fts)) != NULL) { switch (p->fts_info) { @@ -366,7 +366,7 @@ rm_file(char **argv) if (!fflag && !S_ISWHT(sb.st_mode) && !check(f, f, &sb)) continue; rval = 0; - if (!uid && + if (!uid && !S_ISWHT(sb.st_mode) && (sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(sb.st_flags & (SF_APPEND|SF_IMMUTABLE))) rval = lchflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));