Age | Commit message (Collapse) | Author |
|
|
|
and not readable. Prefer write access, since this should work
better with fdatasync.
|
|
(isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
|
|
(word32): Remove. All uses changed to uint32_t.
(isaac_seed_data): Remove unnecessary cast.
|
|
|
|
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.
|
|
|
|
Prompted by a suggestion from Kalle Olavi Niemitalo
in http://bugs.debian.org/207035.
(direct_mode): New function.
(do_wipefd): Turn on direct-mode I/O.
(dopass): If a file's first write fails with EINVAL,
turn off direct-mode I/O and retry the write.
|
|
a write error. Problem reported by Jon Peatfield in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
|
|
fdatasync reports EBADF when syncing (unwritable) directories.
Problem reported by Albert Chin-A-Young in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
|
|
change "%s: remove" to _("%s: failed to remove") and
change "%s: close" to _("%s: failed to close").
|
|
".". But continue to omit +, =, %, @, #, as they're either
shell metacharacters (for some shells) or are not in some
character sets, or (in the case of '%') must be a
metacharacter somewhere.
|
|
|
|
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.
|
|
|
|
|
|
Initialize a buffer to avoid warnings from tools like valgrind.
|
|
(dopass): Align I/O buffers to page boundaries.
|
|
|
|
(main): Don't assume EXIT_FAILURE == 1, as POSIX doesn't require it.
|
|
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.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
Don't include closeout.h.
|
|
|
|
or be careful to choose a size that would not be rounded up and
exceed the maximum value; that could result in a failure of
the final write.
(do_wipefd): --exact is now the default for non-regular
files. Suggestion from Ben Elliston.
(usage): Say it.
|
|
Patch by Michael Stone.
|
|
It's already included via system.h.
|
|
Instead, include "xalloc.h".
|
|
They're already defined in sys2.h.
|
|
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
(OUTPUT_BLOCK_SIZE): remove.
(dopass): When printing progress, use floor for what has been done
so far (since we should be conservative there), and ceiling for
what needs to be done (since that's what other programs use).
|
|
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
|
|
(wipename): Quote file names only when necessary.
(main): Copy quoted string into malloc'd storage so it doesn't
get clobbered when using -u and --verbose.
Minor clean-up.
* src/shred.c:
Use `NULL' rather than `(time_t *) 0'.
(dopass): Use STREQ in place of strcmp.
Add parentheses around use of nested ternary operator.
|
|
(dopass): If verbose, output a line every VERBOSE_UPDATE seconds,
and suppress duplicate output lines. Output a percentage as well
as a count of bytes.
Also, fix comment/code typo regarding how many bytes have been
written; this typo was harmless before, but is no longer harmless with
the above change in effect.
|
|
|
|
|
|
code in lib/ for compiling this program without config.h.
|
|
|
|
is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
Accept 'K' as well as 'k'.
|
|
instead of hard-coding --help and --version descriptions.
|
|
(main): Don't `call' GETTIMEOFDAY_INIT.
|
|
for short options too.''
|
|
the --version option, so this message is consistent with all the rest.
|
|
descriptions are alone in their own string.
|
|
Use fputs, not printf.
|
|
|
|
|