SHA256
1
0
forked from pool/cpio
OBS User unknown 2008-04-12 18:03:36 +00:00 committed by Git OBS Bridge
parent e5d9caaf30
commit 1f222bed0b
3 changed files with 46 additions and 6 deletions

View File

@ -1,6 +1,6 @@
--- src/util.c
+++ src/util.c
@@ -188,7 +188,8 @@ tape_fill_input_buffer (int in_des, int
@@ -188,8 +188,15 @@ tape_fill_input_buffer (int in_des, int
input_size = rmtread (in_des, input_buffer, num_bytes);
if (input_size == 0 && input_is_special)
{
@ -8,9 +8,16 @@
+ if (!tape_eof (in_des))
+ get_next_reel (in_des);
input_size = rmtread (in_des, input_buffer, num_bytes);
+ if (input_size == 0)
+ {
+ if (tape_eod (in_des))
+ get_next_reel (in_des);
+ input_size = rmtread (in_des, input_buffer, num_bytes);
+ }
}
if (input_size < 0)
@@ -354,7 +355,8 @@ tape_buffered_peek (char *peek_buf, int
error (1, errno, _("read error"));
@@ -354,8 +361,15 @@ tape_buffered_peek (char *peek_buf, int
{
if (input_is_special)
{
@ -18,9 +25,16 @@
+ if (!tape_eof (in_des))
+ get_next_reel (in_des);
tmp_input_size = rmtread (in_des, append_buf, io_block_size);
+ if (tmp_input_size == 0)
+ {
+ if (tape_eod (in_des))
+ get_next_reel (in_des);
+ tmp_input_size = rmtread (in_des, append_buf, io_block_size);
+ }
}
else
@@ -828,6 +830,22 @@ tape_offline (int tape_des)
break;
@@ -828,6 +842,40 @@ tape_offline (int tape_des)
#endif
}
@ -34,8 +48,26 @@
+ return 0;
+ }
+
+ if (GMT_EOF(status.mt_gstat))
+ if (GMT_EOF(status.mt_gstat)) {
+ return 1;
+ }
+
+ return 0;
+}
+
+int
+tape_eod( int tape_des)
+{
+ struct mtget status;
+
+ if (rmtioctl (tape_des, MTIOCGET, (char*)&status) == -1) {
+ error (1, errno, "Cannot get tape status");
+ return 1;
+ }
+
+ if (GMT_EOD(status.mt_gstat)) {
+ return 1;
+ }
+
+ return 0;
+}
@ -43,4 +75,3 @@
/* The file on file descriptor TAPE_DES is assumed to be magnetic tape
(or floppy disk or other device) and the end of the medium
has been reached. Ask the user for to mount a new "tape" to continue

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 11 12:55:08 CEST 2008 - lmichnovic@suse.cz
- adjusted eof-handling.patch to check for 'end-of-file' and
'end-of-data' marker when detecting reel change. [bnc#371077]
-------------------------------------------------------------------
Fri Apr 4 15:35:41 CEST 2008 - lmichnovic@suse.cz

View File

@ -17,7 +17,7 @@ License: GPL v3 only
Group: Productivity/Archiving/Compression
AutoReqProv: on
Version: 2.9
Release: 49
Release: 51
Summary: A Backup and Archiving Utility
Source: cpio-2.9.tar.bz2
Patch1: cpio-2.9-no_rmt.patch
@ -119,6 +119,9 @@ ln -sf ../../bin/cpio $RPM_BUILD_ROOT/usr/bin/cpio
%files lang -f %{name}.lang
%changelog
* Fri Apr 11 2008 lmichnovic@suse.cz
- adjusted eof-handling.patch to check for 'end-of-file' and
'end-of-data' marker when detecting reel change. [bnc#371077]
* Fri Apr 04 2008 lmichnovic@suse.cz
- adjusted cpio-2.9-dir_perm.patch acording Red Hat patch to fix
correct dir permissions after extraction in pass-through mode.