Commit Graph

69 Commits

Author SHA1 Message Date
Paul Eggert
81460a0349 (record_buffer): New var.
(open_archive): Don't use valloc; on older or buggy hosts, you can't
free the result.  Use page_aligned_alloc instead.
Record the pointer to be freed into record_buffer.
(close_archive): Free record_buffer.
2004-08-03 04:43:38 +00:00
Sergey Poznyakoff
488430f739 (seek_archive): New function 2004-05-19 14:25:27 +00:00
Sergey Poznyakoff
3e8f210904 (open_archive): Removed assignment to read_full_records_option. 2004-05-11 14:23:25 +00:00
Paul Eggert
2bda83b48d Merge recent gnulib changes, and remove some lint. 2004-04-05 02:29:18 +00:00
Sergey Poznyakoff
106a24176e (open_archive): Clear read_full_records_option
if reading from a pipe.
(short_read): Display warning about the deduced record size
if version > 1
2004-03-22 11:59:35 +00:00
Sergey Poznyakoff
37400fa94e (flush_read): Bugfix: the condition at line 714 included
|| (status > 0 && !read_full_records_option)

which is grossly wrong, since even if new_volume() below succeeds,
the subsequent call to rmtread will overwrite the chunk of data
already read in the buffer and thus spoil everything.
2004-02-29 10:15:45 +00:00
Sergey Poznyakoff
95be2c50b4 (new_volume,check_label_pattern): Changed return type.
(time_to_start_writing): Changed data type
(file_to_switch_to): Removed. Variable never assigned to.
(open_archive) Moved option compatibility checks to tar.c
Other minor changes.
2004-01-03 22:23:48 +00:00
uid65697
278a8945a6 (short_read): Issue a warning on short reads. 2003-12-25 10:18:14 +00:00
Sergey Poznyakoff
80e5de9310 Minor changes 2003-11-17 07:38:37 +00:00
Sergey Poznyakoff
c1b9212b16 Moved system dependencies to system.c 2003-10-04 18:14:32 +00:00
Sergey Poznyakoff
91b2d65e9d Use ngettext where appropriate. 2003-09-05 13:24:15 +00:00
Sergey Poznyakoff
d858a433c8 Use current_stat_info 2003-08-31 22:41:32 +00:00
Sergey Poznyakoff
eb66edaa9f (flush_read): Fixed behavior on short
reads right after opening the new archive (multiv01.sh test).
(new_volume): Special handling for "-".
2003-07-24 14:45:29 +00:00
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