Age | Commit message (Collapse) | Author |
|
|
|
safe_read, to avoid overflow e.g. on 64-bit Solaris sparc.
(dd_copy): Remove unnecessary cast.
|
|
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.
|
|
at the top of the loop, not at the bottom.
|
|
bytes, but consider RECORDS to be a byte count if COUNT_BYTES
is nonzero.
|
|
(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.
|
|
Fix a merge bug exposed by new test.
|
|
adapt skip to skip either by bytes or by blocks
|
|
(main): Report failed fstat.
Complain only when ftruncate fails on a regular file,
a directory, or a shared memory object.
|
|
|
|
|
|
Based on a patch from Michael Stone.
Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
|
|
|
|
(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.
|
|
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.
|
|
|
|
(buggy_lseek_support): New function.
(skip): Use it.
Reported by Martin Gallant via Michael Stone.
|
|
`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.
|
|
From Bob Proulx.
|
|
|
|
(usage): Don't call close_stdout here.
(close_stdout_wrapper): New, kludgey, function and file-scoped global.
(main): Register it with atexit.
|
|
|
|
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.
|
|
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'.
|
|
add a separate `suffix' variable.
|
|
|
|
|
|
(dd_copy): Use those to page-align both the input and output buffers.
|
|
(ROUND_UP_TO_MODULUS): Define.
(dd_copy): Page-align the input buffer.
Based on a patch from Scott Lurndal.
|
|
|
|
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.
|
|
then open it for write and report an error if we can't seek.
|
|
Don't assume the traditional Unix values for mode bits.
|
|
(parse_integer): Migrate most of the work into the new xstrtoumax fn.
|
|
only if we might need to read to satisfy a `seek=' request.
From Matthias Urlichs.
|
|
the loop is gone, manually decrement argc and increment argv.
|
|
via sys2.h.
|
|
(long_options): Remove unused struct.
(scanargs): Remove useless loop.
(main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options.
|
|
[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.
|
|
|
|
xargmatch.
|
|
|
|
|
|
Add support for SI-like suffixes like "GB" and "TD".
(usage): Describe it.
|
|
Don't declare safe_read.
|
|
Use #if !, not #ifndef with HAVE_ macros.
|
|
|
|
|
|
Include "closeout.h".
|
|
to be negative as signed value.
|