Paul Eggert
7ee151d229
(HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
...
it from ever being nonzero. Reported by Pozsar Balazs in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
(human_fstype): Add ramfs, squashfs, sysfs.
Reported by Pozsar Balazs in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
(human_fstype): Return char const *, not char *.
Simplify internals a bit, and avoid casts.
2004-09-03 21:58:36 +00:00
Paul Eggert
4e40831b0c
(print_stat): Don't assume st_ino / st_dev fits in
...
unsigned long; this isn't true for st_ino on Solaris 9.
2004-08-04 22:04:26 +00:00
Paul Eggert
9d06bbe298
(G_fail): Remove.
...
(print_statfs): Print various gotta-be-nonnegative values using
unsigned long int, not long int or int.
(do_statfs, do_stat): Return a boolean success flag.
(do_stat, main): Use bool for booleans.
2004-08-03 19:08:31 +00:00
Jim Meyering
851acad0ce
(usage, main): Output "file system" rather than "filesystem".
...
(long_options, usage): Rename "--filesystem" to
"--file-system". But keep the old name around, for compatibility reasons.
2004-06-30 22:31:43 +00:00
Jim Meyering
1ce7b61d0e
(main): Standardize on the diagnostics given when someone gives
...
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-21 15:03:35 +00:00
Jim Meyering
5c00973123
(print_stat): Update use of xreadlink.
2004-06-01 13:36:40 +00:00
Jim Meyering
b9c4b346f1
undo last change
2004-04-09 12:03:02 +00:00
Jim Meyering
b29e52796a
Don't include "file-type.h", now that system.h does.
2004-04-09 08:26:17 +00:00
Jim Meyering
c0c9569dc4
A specified format is no longer automatically newline terminated.
...
If you want a newline at the end of your format, use `\n'.
(print_it): Don't print a newline at the end of
every format.
(do_statfs): Add a newline at end of each default format string.
2004-04-04 16:22:26 +00:00
Jim Meyering
5937c873e6
(human_time): Correct merge problem.
2004-02-05 13:46:41 +00:00
Jim Meyering
adc816c05a
Include "inttostr.h".
...
(human_time): Print the date/time as a number of seconds since the
epoch if it can't be converted by localtime. This is better than
just saying "invalid", and is consistent with what "ls" does.
Don't dump core if the year has more than 48 digits; this isn't
possible on any contemporary host, but we might as well do it right.
2004-02-05 09:47:01 +00:00
Jim Meyering
e32369feb8
(human_time): Accept time rather than pointer-to-const-time parameter,
...
for clarity. All callers changed.
2004-02-05 09:34:33 +00:00
Jim Meyering
fa377fd8c1
(do_stat): Remove extra trailing newline from default formats.
2004-02-02 17:33:11 +00:00
Jim Meyering
c057bb50b5
Print actual fractional seconds in time stamps, not just `.00000000'.
...
(human_time): Add and use new parameter, t_ns.
(print_stat): Update callers.
2004-02-02 07:59:58 +00:00
Jim Meyering
623c8ae147
(usage): Use EXIT_SUCCESS, not 0, for clarity.
2004-01-21 23:45:21 +00:00
Jim Meyering
02411d8bef
(human_fstype): Use %lx, not %x format for `unsigned long'.
2004-01-08 14:28:44 +00:00
Jim Meyering
cf4fdf373f
Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
...
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-18 10:05:47 +00:00
Jim Meyering
bafd927f03
(WRITTEN_BY): Rename from AUTHORS.
...
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
2003-09-18 22:19:03 +00:00
Jim Meyering
e37cd8f9f4
(print_it): Avoid buffer overrun that would occur
...
when the user-specified format string ends with `%'.
2003-08-27 08:55:01 +00:00
Jim Meyering
6bb625621f
(main): Warn about use of deprecated `-l' option.
2003-08-25 07:39:26 +00:00
Jim Meyering
c63799d99d
(do_stat): For link count at end of line, use %h format,
...
instead of %-5h. The latter would make stat emit trailing spaces.
2003-08-22 08:20:05 +00:00
Jim Meyering
4f4e9aa8e1
Don't include headers already included by system.h:
...
Don't include closeout.h.
2003-07-23 07:29:54 +00:00
Jim Meyering
a54b2d998d
Don't include unistd.h or time.h; system.h already does it.
2003-07-23 07:09:28 +00:00
Jim Meyering
6bcd4b08ba
(main): Call initialize_main.
2003-06-17 18:13:23 +00:00
Jim Meyering
588e9f6a69
Fix for build failure on Ultrix 4.3.
...
Include sys/statvfs.h in preference to sys/vfs.h.
Include sys/param.h and sys/mount.h on ultrix.
2003-06-17 17:40:45 +00:00
Jim Meyering
e4ac725a11
Fix portability problem on FreeBSD5.0: don't include
...
<sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
Use #if/#elif/... cascade so we get only one set of include files.
2003-05-26 20:23:14 +00:00
Jim Meyering
bac1785a6e
add comment
2003-04-10 19:09:30 +00:00
Jim Meyering
c1b5a21a84
(human_fstype) [__linux__]: Append each hex constant from
...
fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2003-04-10 19:07:34 +00:00
Jim Meyering
641cba7b3d
(human_fstype): Handle Linux's devpts.
2003-04-10 18:06:56 +00:00
Jim Meyering
8fd978c223
Add #include directives for Ultrix 4.4.
...
Based on a suggested change from Bert Deknuydt.
2003-04-07 18:11:39 +00:00
Jim Meyering
92b524013b
D'oh.
2003-03-22 22:32:12 +00:00
Jim Meyering
1bf7ea8fd1
Don't include <sys/sysmacros.h>.
...
That is already done via system.h. Otherwise, the multiple
inclusion would evoke redefinition warnings from Cray's /bin/cc
(Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28).
(human_fstype): Factor some directives `up', out of this function.
Cast away `const' to avoid error from Cray's /bin/cc.
2003-03-22 21:32:22 +00:00
Jim Meyering
a1134e1eb6
(print_it): Use putchar, not fputs, to output a single character.
2003-03-07 23:24:53 +00:00
Jim Meyering
b4f567deb9
(usage): Capitalize consistently.
2003-03-04 22:22:19 +00:00
Jim Meyering
fc5797807e
(usage): Tweak wording of %B description.
2003-02-21 12:23:48 +00:00
Jim Meyering
44e80d26cb
(usage) [%b]: Refer to %B.
2003-02-20 19:11:02 +00:00
Jim Meyering
409e7dd0b6
(print_stat): New format: %B (to print ST_NBLOCKSIZE).
...
(usage): Describe it.
2003-02-20 19:07:55 +00:00
Jim Meyering
442dbd2429
(G_fail): New global.
...
(human_time): Diagnose failed localtime, not failed nstrftime.
(main): Fail if G_fail is set.
2003-02-01 09:59:09 +00:00
Jim Meyering
4686f1f3fd
Include "file-type.h"
...
(print_human_type): Remove function.
(human_access): Rename from print_human_access. Return a string.
(human_time): Rename from print_human_time. Return a string.
(print_stat): Arrange so that field width and an alignment specifier
are honored for the %A, %F, %x, %y, and %z formats.
[%F]: Use file_type; this gives slightly different file type strings,
e.g., `directory' instead of `Directory' and `regular file' or
`regular empty file' instead of `Regular file'.
2003-01-31 18:28:39 +00:00
Jim Meyering
fb9e95e6c3
(print_stat): Use S_ISLNK rather than an explicit
...
test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
2003-01-31 13:52:18 +00:00
Jim Meyering
88a5f079b4
(print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
2003-01-27 13:32:44 +00:00
Jim Meyering
eb4832a29c
Remove declaration of nstrftime.
...
Include strftime.h instead.
2002-12-15 20:45:36 +00:00
Jim Meyering
cb173ced29
Don't include <string.h> or <ctype.h>.
...
That's already done via system.h.
2002-12-01 09:49:01 +00:00
Jim Meyering
f2308f74e8
(usage): Transform --help output via s/ - / /,
...
so that help2man produces properly formatted man pages.
2002-11-10 23:24:52 +00:00
Jim Meyering
fab46cb466
(PRIdMAX, PRIuMAX): Remove definitions.
...
Now they're defined through system.h.
2002-09-22 06:48:28 +00:00
Jim Meyering
003ab9a58d
Remove all inclusions of inttypes.h,
...
since it's already included from sys2.h via system.h.
2002-09-22 06:41:02 +00:00
Jim Meyering
e4d4cea119
Don't include malloc.h -- it was unnecessary.
2002-07-26 07:38:35 +00:00
Jim Meyering
33106990a6
(usage): The short form of --dereference is now -L, not -l.
2002-07-22 15:39:12 +00:00
Jim Meyering
6978ba6736
(print_it): Use memcpy and a little pointer arithmetic, rather than stpncpy.
2002-07-16 09:29:52 +00:00
Jim Meyering
e5ee2e3aee
(print_it): Use xstrdup, not strdup.
...
Use strspn to avoid an explicit loop.
Use fputc rather than printf "\n".
Include quote.h.
(print_stat): Use xreadlink, rather than using readlink directly.
Use the quote function rather than hard-coded double quotes.
Use error, not perror.
2002-07-13 08:05:04 +00:00