Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/stat Style sync with FreeBSD. Changes via Doug Bart...



details:   https://anonhg.NetBSD.org/src/rev/7c3e7f430fb9
branches:  trunk
changeset: 535282:7c3e7f430fb9
user:      atatat <atatat%NetBSD.org@localhost>
date:      Tue Aug 13 14:05:41 2002 +0000

description:
Style sync with FreeBSD.  Changes via Doug Barton <DougB%FreeBSD.org@localhost>.

diffstat:

 usr.bin/stat/stat.1 |  12 ++++++++++--
 usr.bin/stat/stat.c |  15 +++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)

diffs (85 lines):

diff -r d855bb8d526b -r 7c3e7f430fb9 usr.bin/stat/stat.1
--- a/usr.bin/stat/stat.1       Tue Aug 13 13:22:35 2002 +0000
+++ b/usr.bin/stat/stat.1       Tue Aug 13 14:05:41 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: stat.1,v 1.5 2002/07/08 18:48:42 atatat Exp $
+.\"    $NetBSD: stat.1,v 1.6 2002/08/13 14:05:41 atatat Exp $
 .\"
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -43,7 +43,7 @@
 .Nd display file status
 .Sh SYNOPSIS
 .Nm
-.Op Fl FLn
+.Op Fl FLnq
 .Oo
 .Fl f Ar format |
 .Fl l |
@@ -104,6 +104,14 @@
 itself.
 .It Fl n
 Do not force a newline to appear at the end of each piece of output.
+.It Fl q
+Suppress failure messages if calls to
+.Xr stat 2
+or
+.Xr lstat 2
+fail.  When run as
+.Nm readlink ,
+error messages are automatically suppressed.
 .It Fl f Ar format
 Display information using the specified format.  See the FORMATS section
 for a description of valid formats.
diff -r d855bb8d526b -r 7c3e7f430fb9 usr.bin/stat/stat.c
--- a/usr.bin/stat/stat.c       Tue Aug 13 13:22:35 2002 +0000
+++ b/usr.bin/stat/stat.c       Tue Aug 13 14:05:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stat.c,v 1.6 2002/07/09 21:25:00 atatat Exp $ */
+/*     $NetBSD: stat.c,v 1.7 2002/08/13 14:05:41 atatat Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,20 +38,19 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.6 2002/07/09 21:25:00 atatat Exp $");
+__RCSID("$NetBSD: stat.c,v 1.7 2002/08/13 14:05:41 atatat Exp $");
 #endif
 
-#include <sys/param.h>
 #include <sys/stat.h>
+#include <sys/syslimits.h>
 
 #include <ctype.h>
+#include <err.h>
 #include <grp.h>
 #include <pwd.h>
 #include <stdio.h>
-#include <fcntl.h>
-#include <err.h>
+#include <stdlib.h>
 #include <string.h>
-#include <stdlib.h>
 #include <time.h>
 #include <unistd.h>
 
@@ -304,7 +303,7 @@
     const char *statfmt, int fn, int nonl, int quiet)
 {
        int flags, size, prec, ofmt, hilo, what;
-       char buf[MAXPATHLEN];
+       char buf[PATH_MAX];
        const char *subfmt;
        int nl, t, i;
 
@@ -500,7 +499,7 @@
 {
        u_int64_t data;
        char *sdata, lfmt[24], tmp[20];
-       char smode[12], sid[12], path[MAXPATHLEN + 4];
+       char smode[12], sid[12], path[PATH_MAX + 4];
        struct passwd *pw;
        struct group *gr;
        const struct timespec *tsp;



Home | Main Index | Thread Index | Old Index