Record an error message if there are write errors when extracting the
content of an archive entry to a file descriptor.
This commit is contained in:
parent
4b9adc2fef
commit
44938dbf6d
@ -28,6 +28,7 @@
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "archive.h"
|
||||
@ -65,8 +66,10 @@ archive_read_data_into_fd(struct archive *a, int fd)
|
||||
if (bytes_to_write > MAX_WRITE)
|
||||
bytes_to_write = MAX_WRITE;
|
||||
bytes_written = write(fd, buff, bytes_to_write);
|
||||
if (bytes_written < 0)
|
||||
if (bytes_written < 0) {
|
||||
archive_set_error(a, errno, "Write error");
|
||||
return (-1);
|
||||
}
|
||||
output_offset += bytes_written;
|
||||
total_written += bytes_written;
|
||||
size -= bytes_written;
|
||||
|
Loading…
Reference in New Issue
Block a user