cpio/cpio-2.11-treat-read-errors.patch

23 lines
755 B
Diff
Raw Normal View History

diff --git a/src/util.c b/src/util.c
index 00953d5..2a821c7 100644
--- a/src/util.c
+++ b/src/util.c
@@ -203,7 +203,7 @@ tape_fill_input_buffer (int in_des, int num_bytes)
get_next_reel (in_des);
input_size = rmtread (in_des, input_buffer, num_bytes);
}
- if (input_size < 0)
+ if (input_size == SAFE_READ_ERROR)
error (1, errno, _("read error"));
if (input_size == 0)
{
@@ -224,7 +224,7 @@ disk_fill_input_buffer (int in_des, off_t num_bytes)
in_buff = input_buffer;
num_bytes = (num_bytes < DISK_IO_BLOCK_SIZE) ? num_bytes : DISK_IO_BLOCK_SIZE;
input_size = read (in_des, input_buffer, num_bytes);
- if (input_size < 0)
+ if (input_size == SAFE_READ_ERROR)
{
input_size = 0;
return (-1);