summaryrefslogtreecommitdiff
path: root/src/dd.c
AgeCommit message (Collapse)Author
2000-12-02(skip, dd_copy): Use ssize_t to store result ofJim Meyering
safe_read, to avoid overflow e.g. on 64-bit Solaris sparc. (dd_copy): Remove unnecessary cast.
2000-12-02Undo most of the changes since 2000-11-24, since we'veJim Meyering
documented a standard way to do it. (skip_bytes, seek_bytes): Remove. (usage): Remove B suffix. (scanargs, skip, dd_copy, main): Remove support for B suffix.
2000-11-26(skip): Perform the `records < blocksize' testJim Meyering
at the top of the loop, not at the bottom.
2000-11-26(skip): New arg COUNT_BYTES. Read with BLOCKSIZEJim Meyering
bytes, but consider RECORDS to be a byte count if COUNT_BYTES is nonzero.
2000-11-26(skip_bytes, seek_bytes): Now booleans, not counts.Jim Meyering
(seek_records): Renamed from seek_record, for consistency with skip_records and max_records. All uses changed. (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB and skip=nB. (enum Unit, Unit): Remove. (skip, dd_copy, main): Undo most recent change. (dd_copy, main): Pass blocksize of 1 as appropriate when skip_bytes or seek_bytes is nonzero. (main): Rework ftruncate failure diagnostic to always use byte count.
2000-11-25more post-merge clean-up.Jim Meyering
Fix a merge bug exposed by new test.
2000-11-25remove bskipJim Meyering
adapt skip to skip either by bytes or by blocks
2000-11-25(S_TYPEISSHM): New macro.Jim Meyering
(main): Report failed fstat. Complain only when ftruncate fails on a regular file, a directory, or a shared memory object.
2000-11-24bskip/bseek patch from Chris Sylvain <csylvain@umm.edu> merged inJim Meyering
2000-11-24Declare a pointer parameters to be `const' as appropriate.Jim Meyering
2000-11-24(main): Use ftruncate only on regular files.Jim Meyering
Based on a patch from Michael Stone. Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
2000-10-22fix typoJim Meyering
2000-08-24Put back the kluge. It's necessary after all.Jim Meyering
(buggy_lseek_support): New function. (skip): Use it. Frank Adler reported that although _llseek returns 0, lseek erroneously returns an offset suggesting the operation succeeded even though it fails.
2000-08-24(skip): Assume lseek failed if it returned zero, since a zero return isJim Meyering
impossible and some buggy drivers return zero. Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the file descriptor is not currently rewound.
2000-08-23back out last changeJim Meyering
2000-08-22Don't even try to use lseek on character devices.Jim Meyering
(buggy_lseek_support): New function. (skip): Use it. Reported by Martin Gallant via Michael Stone.
2000-07-23(main): Give a better diagnostic for e.g.,Jim Meyering
`dd if=/dev/fd0 seek=100000000000'. Convert "`%s'" in format strings to "%s", and wrap each corresponding argument in a `quote (...)' call. Add many, more precise diagnostics.
2000-05-25(close_stdout_wrapper): Don't dereference NULL pointer.Jim Meyering
From Bob Proulx.
2000-05-17tweak commentJim Meyering
2000-05-13Include closeout.h.Jim Meyering
(usage): Don't call close_stdout here. (close_stdout_wrapper): New, kludgey, function and file-scoped global. (main): Register it with atexit.
2000-01-30(main): Exit with nonzero status if ftruncate fails.Jim Meyering
2000-01-18(interrupt_handler):Jim Meyering
Don't use SA_INTERRUPT to decide whether to call sigaction, as POSIX.1 doesn't require SA_INTERRUPT and some systems (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead; it's been part of POSIX.1 since day 1 (in 1988). (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION, to decide whether to call sigaction; this fixes an old typo.
1999-09-19(siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.Jim Meyering
Change lots of count and index variables to be of unsigned type. (dd_copy): Add new unsigned variable, n_bytes_read, in place of many uses of `nread'.
1999-08-22(parse_integer): Add `const' to char* parameter andJim Meyering
add a separate `suffix' variable.
1999-07-27(dd_copy): Free the right obuf.Jim Meyering
1999-07-24add to commentJim Meyering
1999-07-24(PTR_ALIGN, ROUND_UP_OFFSET): New macros.Jim Meyering
(dd_copy): Use those to page-align both the input and output buffers.
1999-07-15Include getpagesize.h.Jim Meyering
(ROUND_UP_TO_MODULUS): Define. (dd_copy): Page-align the input buffer. Based on a patch from Scott Lurndal.
1999-05-07(apply_translations): Use TOUPPER, not toupper.Jim Meyering
1999-05-01Always use STDIN_FILENO for input and STDOUT_FILENOJim Meyering
for output, to avoid confusion with closed input and output fds. (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO and STDOUT_FILENO. (open_fd): New function. (main): Use it, instead of open, to ensure that file descriptors don't get confused. (skip): Don't fstat the input file; the result is no longer used.
1999-04-26(main): If you can't open an output file (with seek=...) read-write,Jim Meyering
then open it for write and report an error if we can't seek.
1999-04-26(main): Use proper mode_t types and macros.Jim Meyering
Don't assume the traditional Unix values for mode bits.
1999-04-18Include xstrtol.h.Jim Meyering
(parse_integer): Migrate most of the work into the new xstrtoumax fn.
1999-04-18(main): Open the output file with *read* accessJim Meyering
only if we might need to read to satisfy a `seek=' request. From Matthias Urlichs.
1999-04-11(scanargs): Fix bug introduced with last change: now thatJim Meyering
the loop is gone, manually decrement argc and increment argv.
1999-03-31Don't include closeout.h or version-etc.h explicitly. Now, they're included ↵Jim Meyering
via sys2.h.
1999-03-26(PROGRAM_NAME, AUTHORS): DefineJim Meyering
(long_options): Remove unused struct. (scanargs): Remove useless loop. (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
1999-03-04Include long-options.hJim Meyering
[long_options]: Remove the "help" and "version" entries. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
1999-02-16update copyright datesJim Meyering
1999-01-16(usage): Don't make it static so that it can be called from libfu.a by ↵Jim Meyering
xargmatch.
1998-11-30(dd_copy): Rename function from `copy'.Jim Meyering
1998-09-19update bug-reporting addressJim Meyering
1998-06-29(__xstrtol), src/dd.c (parse_integer):Jim Meyering
Add support for SI-like suffixes like "GB" and "TD". (usage): Describe it.
1998-05-09Include safe-read.h.Jim Meyering
Don't declare safe_read.
1998-03-15Use #if, not #ifdef with HAVE_ macros.Jim Meyering
Use #if !, not #ifndef with HAVE_ macros.
1998-01-22(quit): Declare to be inline to stifle compile warning.Jim Meyering
1998-01-22Reorder functions to obviate forward dcls.Jim Meyering
1998-01-04(main, usage): Check for write error to stdout before exiting.Jim Meyering
Include "closeout.h".
1997-12-25(skip): Compare lseek return value with -1 to allow itJim Meyering
to be negative as signed value.
1997-12-16s/__P/PARAMS/gJim Meyering