Commit Graph
4311 Commits
Author SHA1 Message Date
Jim Meyering 7c22ac2383 . 2004-04-14 08:43:32 +00:00
Jim Meyering 907e43cc4a . 2004-04-12 09:39:24 +00:00
Jim Meyering 4ed4732e78 Include "utimecmp.h".
(copy_internal): Compare time stamps using utimecmp rather than
MTIME_CMP.
2004-04-12 09:30:57 +00:00
Jim Meyering 8309aea61e Include stat-macros.h, not file-type.h.
Move more definitions into stat-macros.h.
2004-04-09 12:05:45 +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 e357aa96a4 Include file-type.h rather than hard-coding all
of its macros definitions -- the list was slightly out of date.
2004-04-09 08:25:32 +00:00
Jim Meyering 7c7a16a2d8 (O_NOCTTY): Remove redundant decl. 2004-04-08 21:36:18 +00:00
Jim Meyering 9f478111bf (flags, usage): Remove noctty flag.
(main): Always use O_NOCTTY when opening files.
2004-04-08 21:36:06 +00:00
Jim Meyering 82024e9938 (set_fd_flags): Undo part of today's change: it's a little
cleaner -- and more efficient in the common case -- to go
ahead and OR in the -1 when fcntl fails.
2004-04-08 21:30:18 +00:00
Jim Meyering 1af4fd3a54 (dd_copy): Mark two diagnostics for translations. 2004-04-08 21:26:28 +00:00
Jim Meyering a61bca91eb . 2004-04-08 15:38:59 +00:00
Jim Meyering d56fd78b42 (dd_LDADD, shred_LDADD): Add fdatasync's lib. 2004-04-08 15:36:31 +00:00
Jim Meyering 10629f7e88 Correct spelling: s/shasum/sha1sum. 2004-04-08 15:31:08 +00:00
Jim Meyering 2a888f75af (LONGEST_SYMBOL): Tweak comment. 2004-04-08 15:25:39 +00:00
Jim Meyering 470a15a00e (set_fd_flags): Don't OR in -1 when fcntl fails.
Rename parameter, flags, to avoid shadowing global.
2004-04-08 15:20:33 +00:00
Jim Meyering 0c5fbdba06 New dd conv= symbols nocreat, excl, fdatasync, fsync,
and new dd options iflag= and oflag=.

(usage): Document.
(fdatasync) [!HAVE_FDATASYNC]: New macro.
(C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
(input_flags, output_flags): New vars.
(LONGEST_SYMBOL): New macro.
(struct symbol_value): Renamed from struct conversion.  Members
symbol and value renamed from convname and conversion.  The
symbol value is now an array instead of a pointer; this saves
a bit of space and time in practice.  All uses changed.
(conversions): Add nocreat, excl, fdatasync, fsync.  Now const.
(flags): New constant array.
(iflag_error_msgid, oflag_error_msgid): New constants.
(parse_symbols): Renamed from parse_conversion and generalized
to handle either conversion or flag symbols.
(scanargs): Adjust uses of parse_symbols accodingly.  Add
support for iflag= and oflag=.  Reject attempts to use
both excl and nocreat.
(set_fd_flags): New function.
(dd_copy): Just return X rather than calling quit (X), since our
caller invokes quit with the returned value.  Add support for
fdatasync and fsync.
(main): Add support for iflags=, oflags=, and new conv= symbols.
2004-04-08 10:22:05 +00:00
Jim Meyering 273184066e (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW, O_RSYNC, O_SYNC):
Define to 0 if not already defined.
2004-04-08 08:14:02 +00:00
Jim Meyering 733e79ed1f Add support for IUTF8 input flag. 2004-04-07 09:52:22 +00:00
Jim Meyering faa858b57b (makedev) [mkdev && !makedev]: Define makedev to mkdev.
For Interix.
2004-04-06 13:55:00 +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 b275fab12c . 2004-04-04 06:55:58 +00:00
Jim Meyering 1a39890f3c (main): Adjust to new calling convention for set_cloexec_flag. 2004-04-04 06:33:44 +00:00
Jim Meyering dee056cd1b . 2004-03-31 09:01:47 +00:00
Jim Meyering a448e764c3 whoops. Remove old code, too, <blush>. 2004-03-31 08:27:27 +00:00
Jim Meyering 35e3e7e672 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
would not elicit an error.

Include "xstrtol.h" and "quotearg.h".
(main): Don't use atoi.  Use xstrtoul instead.
2004-03-31 08:25:04 +00:00
Jim Meyering d49a6c1a2b . 2004-03-31 07:48:14 +00:00
Jim Meyering ba894b1ea1 [HAVE_SETHOSTNAME && !defined sethostname]:
Declare sethostname, since no Solaris header does it.
2004-03-29 07:30:09 +00:00
Jim Meyering 6de63bb739 Include "vasprintf.h", for asprintf. 2004-03-29 07:29:49 +00:00
Jim Meyering ca6d256f12 Minor optimization:
(process_file): Don't record dev/inode for directories.

Under some circumstances, without -c, du would mistakenly count the
space of hard-linked files, not just the first one it encountered.
Reported by Anthony Thyssen.
(du_files): Don't ever clear the set of `seen' dev/inodes.
2004-03-28 21:43:50 +00:00
Jim Meyering a35cbe5258 (print_grand_total): Rename global from `print_totals'. 2004-03-27 15:44:23 +00:00
Jim Meyering e95d9e93d9 (main): Rearrange filtering loop to be a tiny bit more efficient. 2004-03-27 09:11:25 +00:00
Jim Meyering ba1a527bdd Don't include savedir.h -- no longer needed. 2004-03-27 08:43:36 +00:00
Jim Meyering bb9fed5faa (main): Remove now-unused declaration of `i'. 2004-03-25 17:35:29 +00:00
Jim Meyering ac6954ac17 (main): Filter out file names of length zero before
invoking fts, so that they don't cause fatal errors.
2004-03-25 17:34:11 +00:00
Jim Meyering 210d765150 (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
Remove: not used.
(usage): Say "NUL-terminated", not "NUL-separated".
(main): Check for I/O error when istream is closed.
Allow --files0-from=F even if F is empty; this specifies no files.
(du_files): Now that we allow the list of files to be empty,
handle that case.
2004-03-24 15:13:55 +00:00
Jim Meyering 47ea391c68 (main): Free the hash table, too. 2004-03-23 16:32:11 +00:00
Jim Meyering 805bd8d9c4 . 2004-03-22 22:27:47 +00:00
Jim Meyering 7bafb22e6c (du_files): Return bool, rather than int.
(main): Call readtokens0_free.
2004-03-22 20:17:37 +00:00
Jim Meyering ee6a9e125a Include "readtokens0.h" rather than "readtokens.h".
(main): Use readtoken0 functions rather than readtokens.
Don't use errno when diagnosing readtokens0 failure.
2004-03-22 20:03:38 +00:00
Jim Meyering 51be5c4245 (ds_free): Plug a small leak. 2004-03-21 22:19:09 +00:00
Jim Meyering 03ed43f2b0 (main): whoops. don't use errno for this diagnostic:
_("no files specified in %s"),
2004-03-21 19:18:24 +00:00
Jim Meyering 082a7f8246 . 2004-03-21 18:50:03 +00:00
Jim Meyering f4b7232607 (tsort): Reflect changes in use of readtoken. 2004-03-21 18:45:54 +00:00
Jim Meyering 8def27a37e (do_stdin): Reflect changes in use of readtoken. 2004-03-21 18:45:37 +00:00
Jim Meyering 0fdff6d99a du accepts a new option --from0-file=FILE, where FILE contains
a list of NUL-separated file names.

Include "readtokens.h".
(usage): Describe the new option, and adjust the `Usage':
with this option, no FILE may be specified on the command line.
(main): Handle the new option.
2004-03-21 18:44:25 +00:00
Jim Meyering e0d2db847f . 2004-03-18 06:24:45 +00:00
Jim Meyering 1180a35ccc (touch_LDADD): New macro, since `touch' now needs clock_gettime. 2004-03-17 10:14:17 +00:00
Jim Meyering 1110307672 (enum Time_spec): New enum TIME_SPEC_NS.
(time_spec_string, time_spec, show_date): Support it.
(usage): Remove description of -ITIMESPEC, as it's obsolete and
confusing.  Mention --iso-8601=ns.
(batch_convert): getline returns ssize_t, not int.
2004-03-17 10:07:19 +00:00
Jim Meyering 553e0746b0 (newtime): Now an array of two timespecs, one
for access and one for modification.
(ref_stats): Remove.
(get_reldate): Use get_date's parameter profile.
(touch, main): Adjust to above changes.
(main): Work even if tm_year == INT_MAX (so long as long int is wider).
Use gettime instead of gettimeofday, for new get_date signature.
2004-03-17 10:06:57 +00:00