summaryrefslogtreecommitdiff
path: root/lib/sqfs/data_reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/data_reader.c')
-rw-r--r--lib/sqfs/data_reader.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/sqfs/data_reader.c b/lib/sqfs/data_reader.c
index ec85412..7f857b2 100644
--- a/lib/sqfs/data_reader.c
+++ b/lib/sqfs/data_reader.c
@@ -133,12 +133,10 @@ int data_reader_dump_file(data_reader_t *data, file_info_t *fi, int outfd,
ptr = data->buffer;
}
- ret = write_retry(outfd, ptr, unpackedsz);
- if (ret < 0)
- goto fail_wr;
-
- if ((size_t)ret < bs)
- goto fail_wr_trunc;
+ if (write_data("writing uncompressed block",
+ outfd, ptr, unpackedsz)) {
+ return -1;
+ }
}
}
@@ -152,12 +150,10 @@ int data_reader_dump_file(data_reader_t *data, file_info_t *fi, int outfd,
return -1;
}
- ret = write_retry(outfd, data->buffer, fragsz);
- if (ret < 0)
- goto fail_wr;
-
- if ((size_t)ret < fragsz)
- goto fail_wr_trunc;
+ if (write_data("writing uncompressed fragment",
+ outfd, data->buffer, fragsz)) {
+ return -1;
+ }
}
return 0;
@@ -167,12 +163,6 @@ fail_sparse:
fail_seek:
perror("seek on squashfs");
return -1;
-fail_wr:
- perror("writing uncompressed block");
- return -1;
-fail_wr_trunc:
- fputs("writing uncompressed block: truncated write\n", stderr);
- return -1;
fail_rd:
perror("reading from squashfs");
return -1;