summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2003-07-05 23:10:27 +0000
committerEric Andersen2003-07-05 23:10:27 +0000
commite3393513c5f18e726795103f54b5ffd52a371638 (patch)
tree2841757c7c8bb6c335376caecce0fd4646d48a56
parent9f894f4062dbdd427895a9d12ca06e34791a4fb3 (diff)
downloadbusybox-e3393513c5f18e726795103f54b5ffd52a371638.zip
busybox-e3393513c5f18e726795103f54b5ffd52a371638.tar.gz
Be certain to not abort prematurely when reading stuff from pipes.
-rw-r--r--archival/libunarchive/archive_xread.c2
-rw-r--r--archival/libunarchive/init_handle.c2
-rw-r--r--archival/tar.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/archival/libunarchive/archive_xread.c b/archival/libunarchive/archive_xread.c
index 0b29dbf..d63d0d5 100644
--- a/archival/libunarchive/archive_xread.c
+++ b/archival/libunarchive/archive_xread.c
@@ -25,7 +25,7 @@ extern ssize_t archive_xread(const archive_handle_t *archive_handle, unsigned ch
ssize_t size;
size = archive_handle->read(archive_handle->src_fd, buf, count);
- if (size == -1) {
+ if (size < 0) {
bb_perror_msg_and_die("Read error");
}
diff --git a/archival/libunarchive/init_handle.c b/archival/libunarchive/init_handle.c
index 4b01034..2659aa3 100644
--- a/archival/libunarchive/init_handle.c
+++ b/archival/libunarchive/init_handle.c
@@ -30,7 +30,7 @@ archive_handle_t *init_handle(void)
archive_handle->action_header = header_skip;
archive_handle->action_data = data_skip;
archive_handle->filter = filter_accept_all;
- archive_handle->read = read;
+ archive_handle->read = bb_full_read;
archive_handle->seek = seek_by_jump;
return(archive_handle);
diff --git a/archival/tar.c b/archival/tar.c
index b6c2ef9..93d5fbd 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -526,7 +526,7 @@ static inline int writeTarFile(const char *tarName, const int verboseFlag,
while (1) {
char buf;
- int n = read(gzipStatusPipe[0], &buf, 1);
+ int n = bb_full_read(gzipStatusPipe[0], &buf, 1);
if (n == 0 && vfork_exec_errno != 0) {
errno = vfork_exec_errno;