diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-16 19:29:27 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-16 22:47:59 +0200 |
commit | bfd876dbf151df164b4d87de20aec39b24f205f9 (patch) | |
tree | 53ac348da6c430b1ecf5f546ee4758ac73cb16e0 /lib/sqfs/table.c | |
parent | 74a064d9f15fa2d534e8b2d1ade68d10d5b65dfd (diff) |
cleanup: move error handling into write_retry
If write_retry fails to write everything, it is *always* an error.
This commit renames write_retry to write_data and moves error handling
into the function, making a lot of error handling code redundant.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/table.c')
-rw-r--r-- | lib/sqfs/table.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/sqfs/table.c b/lib/sqfs/table.c index fb6bddc..81e7691 100644 --- a/lib/sqfs/table.c +++ b/lib/sqfs/table.c @@ -15,7 +15,6 @@ int sqfs_write_table(int outfd, sqfs_super_t *super, const void *data, size_t i, blkidx = 0, tblsize; meta_writer_t *m; uint32_t offset; - ssize_t ret; /* Write actual data. Whenever we cross a block boundary, remember the block start offset */ @@ -49,16 +48,8 @@ int sqfs_write_table(int outfd, sqfs_super_t *super, const void *data, *startblock = super->bytes_used; tblsize = sizeof(blocks[0]) * blkidx; - ret = write_retry(outfd, blocks, tblsize); - if (ret < 0) { - perror("writing index table"); + if (write_data("writing table index", outfd, blocks, tblsize)) return -1; - } - - if ((size_t)ret < tblsize) { - fputs("index table truncated\n", stderr); - return -1; - } super->bytes_used += tblsize; return 0; |