mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Correctly report write errors from the lowest-level
output routines back to the compression layer.
This commit is contained in:
parent
5255e61f1a
commit
227b756897
3 changed files with 21 additions and 6 deletions
|
|
@ -111,10 +111,15 @@ static ssize_t
|
|||
file_write(struct archive *a, void *client_data, void *buff, size_t length)
|
||||
{
|
||||
struct write_fd_data *mine;
|
||||
ssize_t bytesWritten;
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
mine = client_data;
|
||||
return (write(mine->fd, buff, length));
|
||||
bytesWritten = write(mine->fd, buff, length);
|
||||
if (bytesWritten <= 0) {
|
||||
archive_set_error(a, errno, "Write error");
|
||||
return (-1);
|
||||
}
|
||||
return (bytesWritten);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -135,10 +135,15 @@ static ssize_t
|
|||
file_write(struct archive *a, void *client_data, void *buff, size_t length)
|
||||
{
|
||||
struct write_file_data *mine;
|
||||
ssize_t bytesWritten;
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
mine = client_data;
|
||||
return (write(mine->fd, buff, length));
|
||||
bytesWritten = write(mine->fd, buff, length);
|
||||
if (bytesWritten <= 0) {
|
||||
archive_set_error(a, errno, "Write error");
|
||||
return (-1);
|
||||
}
|
||||
return (bytesWritten);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -135,10 +135,15 @@ static ssize_t
|
|||
file_write(struct archive *a, void *client_data, void *buff, size_t length)
|
||||
{
|
||||
struct write_file_data *mine;
|
||||
ssize_t bytesWritten;
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
mine = client_data;
|
||||
return (write(mine->fd, buff, length));
|
||||
bytesWritten = write(mine->fd, buff, length);
|
||||
if (bytesWritten <= 0) {
|
||||
archive_set_error(a, errno, "Write error");
|
||||
return (-1);
|
||||
}
|
||||
return (bytesWritten);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue