diff options
Diffstat (limited to 'bin/chflags')
-rw-r--r-- | bin/chflags/Makefile | 3 | ||||
-rw-r--r-- | bin/chflags/Makefile.depend | 2 | ||||
-rw-r--r-- | bin/chflags/chflags.1 | 3 | ||||
-rw-r--r-- | bin/chflags/chflags.c | 33 | ||||
-rw-r--r-- | bin/chflags/tests/Makefile | 2 | ||||
-rw-r--r-- | bin/chflags/tests/Makefile.depend | 1 | ||||
-rw-r--r-- | bin/chflags/tests/chflags_test.sh | 1 |
7 files changed, 13 insertions, 32 deletions
diff --git a/bin/chflags/Makefile b/bin/chflags/Makefile index 1cee973c5655..f0ced5d381dc 100644 --- a/bin/chflags/Makefile +++ b/bin/chflags/Makefile @@ -1,6 +1,3 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $FreeBSD$ - .include <src.opts.mk> PACKAGE=runtime diff --git a/bin/chflags/Makefile.depend b/bin/chflags/Makefile.depend index 6cfaab1c3644..6ef78fac5cbf 100644 --- a/bin/chflags/Makefile.depend +++ b/bin/chflags/Makefile.depend @@ -1,8 +1,6 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ - gnu/lib/csu \ include \ include/xlocale \ lib/${CSU_DIR} \ diff --git a/bin/chflags/chflags.1 b/bin/chflags/chflags.1 index 3160e3780f25..31a4211fb25c 100644 --- a/bin/chflags/chflags.1 +++ b/bin/chflags/chflags.1 @@ -29,9 +29,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)chflags.1 8.4 (Berkeley) 5/2/95 -.\" $FreeBSD$ -.\" .Dd June 12, 2018 .Dt CHFLAGS 1 .Os diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c index 55dedfce53f1..a78ebbfd471d 100644 --- a/bin/chflags/chflags.c +++ b/bin/chflags/chflags.c @@ -29,21 +29,6 @@ * SUCH DAMAGE. */ -#if 0 -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1992, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif - -#ifndef lint -static char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94"; -#endif -#endif - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/types.h> #include <sys/stat.h> @@ -59,7 +44,7 @@ __FBSDID("$FreeBSD$"); static volatile sig_atomic_t siginfo; -static void usage(void); +static void usage(void) __dead2; static void siginfo_handler(int sig __unused) @@ -76,7 +61,7 @@ main(int argc, char *argv[]) u_long clear, newflags, set; long val; int Hflag, Lflag, Rflag, fflag, hflag, vflag, xflag; - int ch, fts_options, oct, rval; + int ch, e, fts_options, oct, rval; char *flags, *ep; Hflag = Lflag = Rflag = fflag = hflag = vflag = xflag = 0; @@ -197,9 +182,17 @@ main(int argc, char *argv[]) if (newflags == p->fts_statp->st_flags) continue; if (chflagsat(AT_FDCWD, p->fts_accpath, newflags, - atflag) == -1 && !fflag) { - warn("%s", p->fts_path); - rval = 1; + atflag) == -1) { + e = errno; + if (!fflag) { + warnc(e, "%s", p->fts_path); + rval = 1; + } + if (siginfo) { + (void)printf("%s: %s\n", p->fts_path, + strerror(e)); + siginfo = 0; + } } else if (vflag || siginfo) { (void)printf("%s", p->fts_path); if (vflag > 1 || siginfo) diff --git a/bin/chflags/tests/Makefile b/bin/chflags/tests/Makefile index e0737b090b95..cd83b67852ad 100644 --- a/bin/chflags/tests/Makefile +++ b/bin/chflags/tests/Makefile @@ -1,5 +1,3 @@ -# $FreeBSD$ - ATF_TESTS_SH+= chflags_test .include <bsd.test.mk> diff --git a/bin/chflags/tests/Makefile.depend b/bin/chflags/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/chflags/tests/Makefile.depend +++ b/bin/chflags/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/chflags/tests/chflags_test.sh b/bin/chflags/tests/chflags_test.sh index 5574e370d68d..0fb3f31259b0 100644 --- a/bin/chflags/tests/chflags_test.sh +++ b/bin/chflags/tests/chflags_test.sh @@ -23,7 +23,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD$ # usage_output='usage: chflags' |