Jim Meyering
09227c31dd
(noinst_HEADERS): Add rand-isaac.h.
2005-12-10 22:54:31 +00:00
Jim Meyering
d5978ad190
Cleaner:
...
Make the local an `int' instead.
2005-12-10 22:10:53 +00:00
Jim Meyering
dfacfaf971
Avoid shred segfault on 64-bit systems.
...
(isaac_refill): Don't try to negate a
local of type uint32_t. Convert it to int32_t first.
2005-12-10 21:58:23 +00:00
Jim Meyering
41c0ee3fe4
* src/rand-isaac.h (isaac_mix): Remove declaration.
2005-12-10 10:18:10 +00:00
Jim Meyering
dbfc16effb
* src/rand-isaac.c (isaac_mix): Declare to be static.
...
Mark all other functions as `extern' so the tight-scope
part of `make distcheck' passes once again.
* src/rand-isaac.h (isaac_mix): Remove declaration.
2005-12-10 10:18:01 +00:00
Jim Meyering
fbaa8e9719
(get_hash): Change position of `*' in parameter type to conform with convention.
...
(main): Split a long line so it fits in 80 columns.
2005-12-10 10:04:12 +00:00
Jim Meyering
d6482a9ac2
Don't include gethrxtime.h. No longer needed.
2005-12-10 10:02:24 +00:00
Jim Meyering
a2b661352b
(keycompare): Remove stray SPACE before TAB that was
...
causing `make distcheck' to fail.
2005-12-10 09:44:00 +00:00
Paul Eggert
569c4876bc
(short_options, long_options, WORDS, keycompare, main):
...
(usage): Add options --random-sort and --seed to implement a random
shuffle.
Include md5.h and rand-isaac.h.
(get_hash): New function.
(rand_state): New var.
(HASH_WORDS, HASH_SIZE): New macros.
2005-12-10 08:09:42 +00:00
Paul Eggert
4013c49f1b
Include rand-isaac.h. Move ISAAC code to rand-isaac.c.
...
(fillrand, main): Adjust to the fact that the state size is now
runtime-configurable.
2005-12-10 08:09:20 +00:00
Paul Eggert
7c2beeafd7
(sort_LDADD): Add $(LIB_GETHRXTIME).
...
(shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
2005-12-10 08:08:52 +00:00
Paul Eggert
71bc739b35
New file, containing ISAAC code that was in shred.c.
...
Make state size runtime-configurable.
(isaac_new, isaac_copy): New functions.
2005-12-10 08:08:05 +00:00
Paul Eggert
a237792d66
Move ISAAC code out of shred.c.
2005-12-10 08:07:36 +00:00
Jim Meyering
99f35425a7
(usage): Mention white space vs -b and -t options.
...
From The Wanderer.
2005-12-09 16:28:17 +00:00
Jim Meyering
843efb8e3b
(main): Fix misleading comment.
2005-12-09 16:22:24 +00:00
Paul Eggert
88afdc99f2
(flags, usage): Add support for noatime flag.
2005-12-07 21:12:12 +00:00
Paul Eggert
cb65d67c2a
(O_NOATIME): Define to 0 if not already defined.
2005-12-07 21:11:45 +00:00
Jim Meyering
c837e0038d
(fchown) [!HAVE_FCHOWN]: Define fchown(...) to -1.
...
(set_owner, preserve_author): New functions, factored out of copy_reg.
(copy_reg): Use them.
(copy_internal): Use them here, too.
From Andreas Gruenbacher.
2005-12-04 23:34:14 +00:00
Jim Meyering
f390052b80
(usage): Say what happens with two or more arguments.
2005-12-04 09:58:34 +00:00
Jim Meyering
a936ac291c
(print_uptime): Move decl of local `upsecs' into scope where it's used.
2005-12-03 23:24:46 +00:00
Jim Meyering
b3e300393e
.
2005-12-03 23:19:58 +00:00
Jim Meyering
08a0a7291f
(long_options): Change the name of each undocumented, for-
...
testing-only option to start with `-', so that it cannot render
ambiguous any prefix it happens to share with some other option name.
2005-12-03 22:23:23 +00:00
Jim Meyering
43233c319e
(long_opts): Change the name of each undocumented, for-
...
testing-only option to start with `-', so that it cannot render
ambiguous any prefix it happens to share with some other option name.
2005-12-03 22:23:09 +00:00
Paul Eggert
e9c8be100e
(show_point): Ignore inaccessible file systems.
...
(usage): -a includes dummy file systems, not size-0 file systems.
2005-11-26 07:51:45 +00:00
Paul Eggert
9b539d8634
(unsigned_long_long_int): Renamed from ulonglong_t,
...
to avoid collision with POSIX name space. All uses changed.
2005-11-26 07:29:48 +00:00
Paul Eggert
25719a3315
Improve performance a bit by optimizing away
...
unnecessary system calls and going to a block size of at least
8192 (on normal hosts, anyway). This improved performance 5% on my
Debian stable host (2.4.27 kernel, x86, copying from root
ext3 file system to itself).
Include "buffer-lcm.h".
(copy_reg): Omit last argument. All callers changed.
Use xmalloc to allocate rather than trusting alloca
(which is unwise with large block sizes).
Declare locals more locally, if possible.
Use uintptr_t words instead of int words, for a bit more speed
when looking for null blocks on 64-bit hosts.
Optimize away reads of zero bytes on regular files.
In the typical case, insist on 8 KiB buffers, at least.
Avoid unnecessary extra call to fstat when checking for sparse files.
Avoid now-unnecessary cast to off_t, and "0L".
Avoid unnecessary test of *new_dst when checking for same owner
and group.
2005-11-24 06:49:44 +00:00
Paul Eggert
1000eb18b6
(rm): Don't assume C99 for-loop syntax.
2005-11-23 04:52:48 +00:00
Jim Meyering
32034e05b7
whoops. Add back decl/definition of n_lengths.
2005-11-22 21:12:28 +00:00
Jim Meyering
f076895070
(AD_push): Remove debugging cruft.
2005-11-22 21:03:36 +00:00
Jim Meyering
5ff678924e
tweak comments
2005-11-22 20:05:48 +00:00
Jim Meyering
66878248f6
.
2005-11-22 15:33:39 +00:00
Jim Meyering
b8616748f2
Rewrite. Now, this module is reentrant on systems
...
that provide openat (Solaris), and on systems like Linux+procfs
where our openat emulation code is reentrant. This also fixes a
few low-probability leaks and eliminates some code that could,
in very unusual circumstances, cause rm() (via a callee) to exit.
2005-11-22 15:04:51 +00:00
Jim Meyering
fd907a33bd
.
2005-11-18 23:12:06 +00:00
Jim Meyering
ca7cafb093
(AD_mark_helper): Make a char *' parameter const'.
...
(AD_mark_current_as_unremovable): Likewise, but for a local.
(rm_1): Likewise.
2005-11-17 20:17:47 +00:00
Jim Meyering
97de3a32b6
(basename_is_dot_or_dotdot): Correct wording in comment.
2005-11-17 12:28:34 +00:00
Paul Eggert
24ce72f635
(do_link, usage): Improve quality of ln's diagnostics.
...
(do_link): Don't use alloca on a buffer of unbounded size.
2005-11-16 22:32:45 +00:00
Jim Meyering
fd13239884
remove now-unused file
2005-11-12 08:39:27 +00:00
Jim Meyering
38a1bfa703
.
2005-11-12 08:29:35 +00:00
Paul Eggert
6837183d42
(decode_switches): ls now defaults to --time-style='locale', which in
...
turn acts like --time-style='posix-long-iso' if the locale settings
are messed up.
2005-11-08 20:59:49 +00:00
Jim Meyering
1ab59b0b84
(usage): Fix descriptions of --sort, --time.
2005-11-07 21:42:23 +00:00
Jim Meyering
a8d0fd4c1b
Include filenamecat.c.
...
(FILE_BASENAME_CONCAT): Remove.
(do_link): Remove last arg DEST_IS_DIR. All callers changed.
(main): Use file_name_concat, base_name, and strip_trailing_slashes
instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids
the use of alloca.
2005-11-05 09:34:57 +00:00
Jim Meyering
933576b440
(process_file): Don't overflow for files of size >= 2^31
...
on systems with stat.st_blocks of a signed 32-bit type.
This bug causes trouble on some AIX 5.1 systems.
Report and trivial patch from Paul Townsend:
<http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html >
2005-11-04 10:08:51 +00:00
Paul Eggert
b38883ea2f
(usage): Don't mention rm -d.
2005-11-02 21:53:20 +00:00
Paul Eggert
ce1d20289c
(rm_option_init): Don't initialize unlink_dirs member, which went away.
2005-11-02 21:52:33 +00:00
Paul Eggert
11fc9bca5f
(struct rm_options): Remove unlink_dirs.
2005-11-02 21:51:57 +00:00
Jim Meyering
588df316d9
(remove_entry): Emit a better diagnostic when rm
...
(without -r) fails to remove a directory on a non-Linux system.
This change affects only newer Solaris systems (with priv_*
functions like priv_allocset). Reported by Keith Thompson.
2005-11-02 09:47:39 +00:00
Paul Eggert
a2bacbdc9c
(main): Pass PDS_PRE_2000 to posixtime.
2005-11-01 23:42:36 +00:00
Paul Eggert
99f09784cc
(parse_obsolete_option): Implement fix for "tail -c 2 FILE".
2005-11-01 23:05:29 +00:00
Paul Eggert
91f8e15bff
(skip): Fix off-by-one error reported by Theodoros V. Kalamatianos.
2005-10-31 08:39:14 +00:00
Paul Eggert
50a6da201b
(FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
...
boundary between DEST and SOURCE in the result.
2005-10-28 22:17:00 +00:00