Commit Graph
18471 Commits
Author SHA1 Message Date
Jim Meyering 06dc5c8efa *** empty log message *** 2004-05-17 12:10:55 +00:00
Jim Meyering 58f134b649 Use -h where necessary to retain semantics. 2004-05-17 12:10:43 +00:00
Jim Meyering a432ab952a *** empty log message *** 2004-05-17 12:08:24 +00:00
Jim Meyering 636a950344 chgrp and chown now dereference symlinks by default, per POSIX.
(usage): Update to reflect this.
2004-05-17 12:08:09 +00:00
Jim Meyering c2740635cd (chopt_init): Affect each symlink referent by default. 2004-05-17 12:07:48 +00:00
Jim Meyering 36708ba6b5 *** empty log message *** 2004-05-17 12:07:30 +00:00
Jim Meyering 3591f10746 chgrp and chown now dereference symlinks by default, per POSIX.
(chgrp invocation, chown invocation): Document it.
2004-05-17 12:07:25 +00:00
Jim Meyering 37adce2680 chown --dereference did nothing when the owner/group of a
symlink matched the desired owner/group.  Reported by David Malone.
Also reported in 1999 as http://bugs.debian.org/39642.

(change_file_owner): When --dereference has
been specified, and when processing a symlink, stat it to get the
owner and group of the referent.
2004-05-16 21:39:35 +00:00
Jim Meyering 23e13a64a8 *** empty log message *** 2004-05-16 19:32:37 +00:00
Jim Meyering 3bb407ccf3 In shred, check for errors from fdatasync more carefully. If
fdatasync fails with errno==EINVAL, it means this implementation
does not support synchronized I/O for this file.  Do not report
this as an error, as (for example) AIX 5.2 fdatasync reports it
for raw disk devices.  Problem reported by Albert Chin in
<http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.

Check for write errors, though: the old code ignored them.
Improve error checking in a few other cases, too (e.g., close of a
directory).

Also, change several 'int' values to 'bool', so that the error
checking is a bit clearer.  Similarly, change unsigned values
to size_t where appropriate.

* src/shred.c: Include "dirname.h".
(datasync) [!HAVE_FDATASYNC]: Remove.
(dosync): New function.
(dopass): Use it.  Return 1 on write error, -1 on other error.
All callers changed.  Report write error if dosync does.
(do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
not int (0/-1).  All callers changed.  Return false if there's a
write error.
(incname): Return bool (true/false), not int (0/1).  Accept
size_t length, not unsigned.  All callers changed.  Do not
bother checking for non-digits; it can't happen.  Replace
recursion with iteration.
(wipename): Use dir_name, base_name, etc. instead of assuming
Unix file names.  Use size_t for length, not unsigned.
Report error if unlink or close fails.
(wipename, main): Use bool for booleans.

(names): Use only digits and uppercase letters, for greater
portability.
2004-05-16 19:32:30 +00:00
Jim Meyering 1f90c86c41 *** empty log message *** 2004-05-16 14:18:50 +00:00
Jim Meyering be8365288d *** empty log message *** 2004-05-16 14:17:53 +00:00
Jim Meyering 877467bc0c (TESTS): Add deref. 2004-05-16 14:10:17 +00:00
Jim Meyering 0c1db9f1ca New test for the yesterday's change. 2004-05-16 14:10:10 +00:00
Jim Meyering 85347c1744 *** empty log message *** 2004-05-15 18:27:38 +00:00
Jim Meyering bbc182cdd8 . 2004-05-15 14:59:15 +00:00
Jim Meyering c54468df2e (AD_pop_and_chdir): Eliminate an unnecessary call to AC_stack_top. 2004-05-14 15:47:53 +00:00
Jim Meyering c134ce8fab . 2004-05-14 09:16:23 +00:00
Jim Meyering 784b5000f7 *** empty log message *** 2004-05-14 07:34:16 +00:00
Jim Meyering 8e0b4648a6 Improve performance of `sort -m' on large files, at the cost of
making some contrived examples unsafe.  POSIX allows this
optimization.  Performance problem reported by Jonathan Baker in
<http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00071.html>.

(first_same_file): Do not treat input pipes
differently from other files.
2004-05-14 07:34:09 +00:00
Jim Meyering f64a45d112 Document that "sort -m -o F" might write F before reading all the input. 2004-05-14 07:33:48 +00:00
Jim Meyering eed02be1b6 *** empty log message *** 2004-05-14 07:33:23 +00:00
Jim Meyering d667552245 (sort invocation): Document that "sort -m -o F"
might write F before reading all the input.
2004-05-14 07:32:56 +00:00
Jim Meyering af7f1c5b2a *** empty log message *** 2004-05-14 07:29:41 +00:00
Jim Meyering a79866eb4a *** empty log message *** 2004-05-14 07:29:04 +00:00
Jim Meyering ec0c3e624c Fix typo: s/supercede/supersede/. 2004-05-14 07:28:39 +00:00
Jim Meyering f490076195 *** empty log message *** 2004-05-13 07:27:25 +00:00
Jim Meyering 62f51917b8 (unquote, make_printable_str): Use e.g. '\a' rather than '\007',
for portability to EBCDIC hosts.
2004-05-13 07:27:10 +00:00
Jim Meyering 179af74c1a (print_esc_char): Use e.g. '\a' rather than '\007',
for portability to EBCDIC hosts.
2004-05-13 07:26:46 +00:00
Jim Meyering 364d39ccd8 (print_ascii, dump_strings): Use e.g. '\a' rather than
'\007', for portability to EBCDIC hosts.
2004-05-13 07:26:14 +00:00
Jim Meyering 07c04a2026 *** empty log message *** 2004-05-13 07:05:05 +00:00
Jim Meyering 23006caee3 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
* src/Makefile.am (all_programs.list): New rule, copied from
	man/Makefile.am and tests/Makefile.am, except that we use the
	system tr rather than ./tr and we don't use tr -s.
	* tests/Makefile.am (all_programs): Use it.
	* man/Makefile.am (all_programs): Likewise.  Renamed from programs,
	for consistency.  All uses changed.
2004-05-13 07:04:58 +00:00
Jim Meyering 2b4882c233 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
* src/Makefile.am (all_programs.list): New rule, copied from
	man/Makefile.am and tests/Makefile.am, except that we use the
	system tr rather than ./tr and we don't use tr -s.
	* tests/Makefile.am (all_programs): Use it.
2004-05-13 07:03:52 +00:00
Jim Meyering 50f956a0b0 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
(all_programs.list): New rule, copied from
man/Makefile.am and tests/Makefile.am, except that we use the
system tr rather than ./tr and we don't use tr -s.
2004-05-13 07:03:00 +00:00
Jim Meyering bcadb97f7c *** empty log message *** 2004-05-12 09:35:19 +00:00
Jim Meyering 9549a2091e (AD_pop_and_chdir): Move lstat-`.' into if-block
where the result is used.  This avoids one unnecessary lstat call
per command line argument.
2004-05-12 09:35:06 +00:00
Jim Meyering 647df13889 *** empty log message *** 2004-05-11 19:41:37 +00:00
Jim Meyering 4dbfc4c582 (TESTS): Add unread3. 2004-05-11 19:41:33 +00:00
Jim Meyering bcd1f744af New test, for the above fix and today's lib/save-cwd.c improvement. 2004-05-11 19:41:23 +00:00
Jim Meyering 6202854ac2 *** empty log message *** 2004-05-11 18:34:56 +00:00
Jim Meyering 76a6665c13 (save_cwd): If opening `.' read-only fails, try write-only. 2004-05-11 18:34:38 +00:00
Jim Meyering ea85958d52 *** empty log message *** 2004-05-11 18:25:32 +00:00
Jim Meyering 3f84f91c7c *** empty log message *** 2004-05-11 16:50:25 +00:00
Jim Meyering 546b62a2bc *** empty log message *** 2004-05-11 16:48:42 +00:00
Jim Meyering 8853d12319 (save_cwd) [HAVE_FCHDIR]: Don't fail just
because opening `.' failed.  Resort to using xgetcwd.
2004-05-11 16:42:17 +00:00
Jim Meyering 52e15d0127 *** empty log message *** 2004-05-11 16:14:22 +00:00
Jim Meyering 0a9f091665 Don't include "save-cwd.h". It's no longer used. 2004-05-11 16:14:11 +00:00
Jim Meyering 128e1b2963 . 2004-05-10 18:15:41 +00:00
Jim Meyering 85b5ea3839 *** empty log message *** 2004-05-10 15:13:52 +00:00
Jim Meyering 6e73791bd4 (TESTS): Add trap. 2004-05-10 15:13:45 +00:00