summaryrefslogtreecommitdiff
path: root/src/shred.c
AgeCommit message (Collapse)Author
2005-06-19(usage): Use `file system', not `filesystem'.Jim Meyering
2005-06-17(usage): Clarify that shred works on an ext3 fileJim Meyering
system as long as it's not in data=journal mode. Tiny change by Mark Melahn.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-11Include unistd-safer.h.Paul Eggert
(wipename): Use fd_safer on directory file descriptor. (wipefile): Remove special case for /dev/fd/* on older hosts. It didn't work in general, and wasn't documented. Use fd_safer.
2005-04-09Remove all uses of signals; modern hosts havePaul Eggert
/dev/random and don't need this gorp. Do not include signal.h. (env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
2005-03-06Remove register keyword.Jim Meyering
2005-02-21Include gethrxtime.h.Paul Eggert
(isaac_seed): Use gethrxtime rather than a mishmash.
2005-01-15(isaac_seed) [HAVE_GETHRTIME]: #if-0 this block,Jim Meyering
because just calling gethrtime evokes an `illegal instruction' failure when compiled with Sun's c89 on Solaris 8 and 9.
2005-01-15(isaac_seed) [HAVE_GETHRTIME]: Don't call ISAAC_SEEDJim Meyering
twice with the same value of `t'. Replace nested #if-#else blocks with #if-#elif-#elif chain.
2004-09-21Remove unused "case 0".Paul Eggert
2004-08-10(usage): "-" is an operand, not an option.Paul Eggert
2004-08-09(wipename): Work even if the directory is writeablePaul Eggert
and not readable. Prefer write access, since this should work better with fdatasync.
2004-08-03(struct Options, main): Use bool for booleans.Paul Eggert
(isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
2004-08-02(UINT_MAX_32_BITS): Remove.Paul Eggert
(word32): Remove. All uses changed to uint32_t. (isaac_seed_data): Remove unnecessary cast.
2004-06-30(usage, main): Output "file system" rather than "filesystem".Jim Meyering
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
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-08(direct_mode): Turn it on/off with directio, too.Jim Meyering
2004-06-07Enable direct-mode I/O (bypassing the buffer cache), if possible.Jim Meyering
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.
2004-06-04(dopass): Don't subtract 1 from the offset afterJim Meyering
a write error. Problem reported by Jon Peatfield in: http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
2004-05-30(dosync): Ignore EBADF errors, as IRIX 6.5Jim Meyering
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
2004-05-20Use translatable diagnostics, e.g.Jim Meyering
change "%s: remove" to _("%s: failed to remove") and change "%s: close" to _("%s: failed to close").
2004-05-18(names): Bring back lower-case letters, "_", andJim Meyering
".". 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.
2004-05-17(incname): Decrement `len' only once per loop iteration.Jim Meyering
2004-05-16In shred, check for errors from fdatasync more carefully. IfJim Meyering
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-06(do_wipefd): Use xnmalloc, rather than xmalloc.Jim Meyering
2004-04-20(sigill_handler, isaac_seed_machdep): Use void, not (obsolete) RETSIGTYPE.Jim Meyering
2004-04-19(isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:Jim Meyering
Initialize a buffer to avoid warnings from tools like valgrind.
2004-04-15Include getpagesize.h.Jim Meyering
(dopass): Align I/O buffers to page boundaries.
2004-04-08(O_NOCTTY): Remove redundant decl.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(main): Don't assume EXIT_FAILURE == 1, as POSIX doesn't require it.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
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-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-03-08Before, when using shred on a device, one had to specify --exact,Jim Meyering
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.
2003-01-13(long_opts): --zero does not require an argument.Jim Meyering
Patch by Michael Stone.
2003-01-10Don't include xalloc.h.Jim Meyering
It's already included via system.h.
2003-01-10Remove declaration of xstrdup.Jim Meyering
Instead, include "xalloc.h".
2003-01-04[S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.Jim Meyering
They're already defined in sys2.h.
2002-12-15Remove all uses of `PARAMS'.Jim Meyering
2002-11-05(dopass):Jim Meyering
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).
2002-09-28(dopass): Use a uintmax_t temporary to avoid bogus compiler warnings.Jim Meyering
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-02-01* src/shred.c: (VERBOSE_UPDATE): Update every 5 seconds, not every 10.Jim Meyering
(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.
2002-02-01(VERBOSE_UPDATE): Now counts seconds, not bytes.Jim Meyering
(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.
2002-01-21Don't include "xalloc.h", as system.h already does that via sys2.h.Jim Meyering
2002-01-12(usage): Also mention Ext3.Jim Meyering