Age | Commit message (Collapse) | Author |
|
|
|
(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.
|
|
|
|
FILE *is* truncated. Reported by Miles Bader.
Remove incomplete, usage-like comment at top of file.
|
|
Reported by Miles Bader.
|
|
|
|
("human.h"): Include.
(input_blocksize, output_blocksize, conversion_blocksize):
Now size_t instead of long. 0 means unset.
(skip_records, seek_record, max_records): Now uintmax_t, not long.
(w_partial, w_full, r_partial, r_full, r_truncate):
Now uintmax_t instead of unsigned.
(print_stats): Print counts as uintmax_t, not unsigned.
(main, skip): Check for overflow when computing file offsets.
(skip): Records count arg is uintmax_t, not long; blocksize arg is
size_t, not long. Try lseek even on non regular files, as per comment.
(oc, col): Now size_t, not int.
(copy): No need to check max_records >= 0 any more, as the
default value is now effectively infinity.
Cast lseek arg to off_t.
(copy, copy_with_block): conversion_blocksize - col can never
be negative now, since it's unsigned, so rewrite loops to
avoid problems with unsigned.
(scanargs): Parse numeric args using uintmax_t, not int.
Check for overflow when converting block size args to size_t.
Blocksize options are now unsigned, and are now 0 when not set yet.
(parse_integer): Return uintmax_t, not int; accept new int * arg
to store error indicator, since all returned values are now valid.
Check for overflow when scanning integer.
|
|
|
|
|
|
|
|
(siginfo_handler): New function to handle SIGINFO/SIGUSR1.
(handle_sig): New function.
(main): Use handle_sig instead of open-coding it.
Handle SIGINFO (or SIGUSR1 if that's not defined).
(print_stats): Move definition to precede first reference.
Remove prototype.
|
|
|
|
|
|
|