summaryrefslogtreecommitdiff
path: root/lib/util/padd_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/padd_file.c')
-rw-r--r--lib/util/padd_file.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/util/padd_file.c b/lib/util/padd_file.c
index 8598b8b..2f1ea9a 100644
--- a/lib/util/padd_file.c
+++ b/lib/util/padd_file.c
@@ -9,7 +9,6 @@ int padd_file(int outfd, uint64_t size, size_t blocksize)
size_t padd_sz = size % blocksize;
int status = -1;
uint8_t *buffer;
- ssize_t ret;
if (padd_sz == 0)
return 0;
@@ -20,21 +19,15 @@ int padd_file(int outfd, uint64_t size, size_t blocksize)
if (buffer == NULL)
goto fail_errno;
- ret = write_retry(outfd, buffer, padd_sz);
-
- if (ret < 0)
- goto fail_errno;
-
- if ((size_t)ret < padd_sz)
- goto fail_trunc;
+ if (write_data("padding output file to block size",
+ outfd, buffer, padd_sz)) {
+ goto out;
+ }
status = 0;
out:
free(buffer);
return status;
-fail_trunc:
- fputs("padding output to block size: truncated write\n", stderr);
- goto out;
fail_errno:
perror("padding output file to block size");
goto out;