Commit Graph

56 Commits

Author SHA1 Message Date
Paul Eggert
664f2dbdd9 (print_total_written): Adjust to new human.h interface.
(child_open_for_compress): Do not increase size to BLOCKSIZE.
(open_archive): Open index file name.
Strip trailng slahes from file names.
(flush_write): Set size to 0 if not saving names.
(flush_write, flush_read): Use safer_name_suffix rather than
inline code.
2003-07-05 06:19:54 +00:00
Paul Eggert
7f1bf2e09f just ignore them silently. 2001-09-26 20:53:42 +00:00
Paul Eggert
9a15fcf491 (write_archive_buffer, close_archive): If an archive is a socket,
treat it like a FIFO.
2001-09-23 05:03:42 +00:00
Paul Eggert
0e041a7bfe (records_read, records_written): New vars.
(write_archive_to_stdout): Now bool, not int.
(open_archive, flush_write, flush_read): Keep records_read and
records_written up to date.
2001-09-22 00:47:09 +00:00
Paul Eggert
58e97f92d3 (new_volume): Stop if the script exits with an error. 2001-08-27 14:14:17 +00:00
Paul Eggert
3b6f724b92 (<time.h>): Do not include; system.h now does this.
(time): Remove decl; likewise.
(child_open_for_uncompress): Use new full_write semantics.
(flush_write): Use ISSLASH instead of testing for '/'.
(flush_read): Likewise.
2001-01-13 05:59:29 +00:00
Paul Eggert
7abb9b854d (flush_read): If read_full_records_option, try to fill the input buffer,
as --delete -f - needs this.
2000-10-28 05:54:42 +00:00
Paul Eggert
29c1020f91 (check_label_pattern): Make sure header name is a string before
passing it to fnmatch.
(init_volume_number): Check for global_volno overflow.
(new_volume): Check for global_volno overflow.
2000-10-25 05:21:06 +00:00
Paul Eggert
4dcebd9655 (_GNU_SOURCE): Remove; autoconf now does this.
(child_open_for_compress, child_open_for_uncompress, close_archive):
Propagate any failure of the compression process back to "tar".
(open_archive, flush_write, flush_read, close_archive):
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.
(open_archive): Don't bother checking S_ISCHR of /dev/null.
(backspace_output): Don't try to backspace past start of archive.
(close_archive): Remove special case for DELETE_SUBCOMMAND.
2000-10-24 06:18:37 +00:00
Paul Eggert
ba2ef4d075 Update copyright year. 2000-01-07 23:02:32 +00:00
Paul Eggert
cae3ad0d8e (archive_write_error): Add noreturn attribute to decl.
(xclose): Use close_error.
(xdup2): Regularize messages with rest of tar.
(archive_write_error): Use write_fatal_details.
(flush_read): Don't read past EOF.
(flush_archive, close_archive, new_volume): Use close_warn.
2000-01-07 19:25:23 +00:00
Paul Eggert
196caec187 (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
archive_write_error, archive_read_error, flush_archive, close_archive,
init_volume_number, new_volume):
Don't assume that gettext preserves errno.

(xdup2): Don't report errno if dup returns an unexpected nonnegative value.
(open_archive): Reject multivolume verify attempts a bit earlier.
Rename local variable `access', in case it's defined by system header.

(open_archive, backspace_output): Use `Cannot' uniformly, instead of
`Could not' sometimes and `Cannot' others.

(open_archive, flush_read, flush_archive, close_archive, new_volume):
Quote arbitrary strings in diagnostics.

(read_error): Set archive to STDOUT_FILENO temporarily when writing
archive buffer.

(init_volume_number): Check for input and output errors in volno_file.

(new_volume): Use new fatal_exit function to exit, and new xfork
function to fork.
1999-12-13 02:51:14 +00:00
Paul Eggert
c9f5ead8de Remove bogus errno FIXMEs. 1999-12-03 13:04:17 +00:00
Paul Eggert
29929863e8 (write_error): Read error is an error, not just a warning. 1999-09-25 05:47:17 +00:00
Paul Eggert
10f585ea2f (print_total_written): Use a format compatible with
Amanda 2.4.1p1.
1999-09-25 00:25:36 +00:00
Paul Eggert
17e0cd7065 (<human.h>): Include.
(print_total_written): Also print human-readable byte count, and bytes/s.
(open_archive, flush_write): Use start_time, not current time.
(flush_read): Report about garbage bytes ignored at end of archive,
but act on non-garbage bytes (instead of ignoring them).
(new_volume): Use WARN for warnings.
1999-09-20 06:28:45 +00:00
Paul Eggert
b8ae0938a4 Lint cleanup.
(open_archive): Use American spelling in diagnostic.
1999-08-23 09:55:55 +00:00
Paul Eggert
9939476576 Comment fix. 1999-08-18 07:49:49 +00:00
Paul Eggert
0357ce3365 indenting fixes. 1999-08-16 08:13:20 +00:00
Paul Eggert
203dea13a4 (time): Don't declare if defined.
(child_open_for_compress): Undo previous change.
(close_archive): Use waitpid, POSIX-style, instead of old BSD style.
(new_volume): Likewise.
1999-08-14 07:10:19 +00:00
Paul Eggert
1027b84330 (_GNU_SOURCE): Define.
(<fnmatch.h>): Include unconditionally.
(child_open_for_compress): Dup after closing, to avoid possible file
descriptor exhaustion.
(flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
(flush_read): Likewise.
1999-08-11 12:47:01 +00:00
Paul Eggert
2ca2d1cb99 (new_volume): Invoke apply_delayed_set_stat before exiting. 1999-07-20 19:48:30 +00:00
Paul Eggert
d8f0da985a (total_written): Remove; replaced with prev_written + bytes_written.
(prev_written): New var.
(init_total_written): New function.
(print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
1999-07-17 01:49:35 +00:00
Paul Eggert
de1db1ed96 (is_regular_file): Don't succeed on files that we can't access due to
permissions problems.
(open_archive): Fix wording on fatal error message.
Don't bother to stat /dev/null if the archive is not a character
special device.
1999-07-12 13:03:58 +00:00
Paul Eggert
d46735235b Rename full_read to safe_read. 1999-07-05 06:47:59 +00:00
Paul Eggert
6eafcf3c9d Add braces to pacify gcc -Wall. 1999-07-02 21:05:50 +00:00
Paul Eggert
99dc4251f9 (child_open_for_compress): Use portable modes.
(child_open_for_uncompress, open_archive): Likewise.
(backspace_output): Use portable whence values.
(close_archive): Likewise.  Remove ending_file_option.
1999-07-02 06:08:46 +00:00
Paul Eggert
aa985330d5 \a doesn't work with msgfmt.
Fix copyright notice.
1999-07-01 21:01:44 +00:00
Paul Eggert
1521a94b11 Handle EINTR correctly; use STDIN_FILENO instead of 0, etc. 1999-06-29 02:26:25 +00:00
Paul Eggert
ee734033e8 (write_archive_buffer): New function.
(child_open_for_compress, flush_write, flush_read): Use it to write
buffers.
(open_archive): Report error if fstat of archive fails.
Improve efficiency of check for /dev/null.
Also, fix some corner cases with remote archives and /dev/null checking.
(close_archive): Test for input fifo only if not remote.
Truncate output archive only if it's not remote.
1999-06-25 23:28:08 +00:00
Paul Eggert
5019d3b2d9 (backspace_output, close_archive): Cast rmtlseek position arg to off_t,
for benefit of K&R compilers with long long.
1999-01-28 00:28:41 +00:00
junio
4559fdbfb1 Implement -E (ending-file) option. 1997-12-04 07:07:11 +00:00
Paul Eggert
ac8cfdacf6 (record_start_block, save_totsize, save_sizeleft, real_s_totsize,
real_s_sizeleft, current_block_ordinal): Now off_t.
(write_error): Arg is now ssize_t.
(child_pid): Now pid_t.
(available_space_after): Now size_t.

(child_open_for_compress, child_open_for_uncompress, flush_write,
open_archive, flush_write, write_error, flush_read, close_archive):
Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
casts.  Use unsigned long to print *_t types, except use
STRINGIFY_BIGINT for off_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
27e87f4f2f GNU tar 1.12 1997-04-25 13:48:46 +00:00
François Pinard
d5740ff9e8 *** empty log message *** 1994-11-16 02:47:35 +00:00
François Pinard
5d7f82cb43 *** empty log message *** 1994-11-16 02:47:32 +00:00
François Pinard
a2aa567aec *** empty log message *** 1994-11-16 02:47:29 +00:00
François Pinard
7f91a90a9c *** empty log message *** 1994-11-16 02:47:25 +00:00
François Pinard
ed3fb00d0c *** empty log message *** 1994-11-16 02:47:22 +00:00
François Pinard
9044aa8d81 *** empty log message *** 1994-11-16 02:47:19 +00:00
François Pinard
0afb59a03f *** empty log message *** 1994-11-16 02:47:16 +00:00
François Pinard
363eb1d48a *** empty log message *** 1994-11-16 02:47:13 +00:00
François Pinard
474bce237b *** empty log message *** 1994-11-16 02:47:08 +00:00
François Pinard
4156fce552 *** empty log message *** 1994-11-16 02:47:05 +00:00
François Pinard
570ead1f48 *** empty log message *** 1994-11-16 02:47:03 +00:00
François Pinard
1cc1540ea0 *** empty log message *** 1994-11-16 02:47:00 +00:00
François Pinard
80df629d39 *** empty log message *** 1994-11-16 02:46:57 +00:00
François Pinard
0eceef9ba1 *** empty log message *** 1994-11-16 02:46:54 +00:00
François Pinard
3da5aa6973 *** empty log message *** 1994-11-16 02:46:51 +00:00
François Pinard
9e7c78e78d *** empty log message *** 1994-11-16 02:46:48 +00:00