aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tar/Makemodule.am1
-rw-r--r--lib/tar/padd_file.c4
-rw-r--r--lib/tar/write_header.c6
-rw-r--r--lib/tar/write_retry.c (renamed from lib/util/write_data.c)6
-rw-r--r--lib/util/Makemodule.am2
5 files changed, 10 insertions, 9 deletions
diff --git a/lib/tar/Makemodule.am b/lib/tar/Makemodule.am
index f0945ff..abc0209 100644
--- a/lib/tar/Makemodule.am
+++ b/lib/tar/Makemodule.am
@@ -3,6 +3,7 @@ libtar_a_SOURCES += lib/tar/number.c lib/tar/checksum.c lib/tar/cleanup.c
libtar_a_SOURCES += lib/tar/read_sparse_map.c lib/tar/read_sparse_map_old.c
libtar_a_SOURCES += lib/tar/base64.c lib/tar/urldecode.c lib/tar/internal.h
libtar_a_SOURCES += lib/tar/padd_file.c lib/tar/read_retry.c include/tar.h
+libtar_a_SOURCES += lib/tar/write_retry.c
libtar_a_CFLAGS = $(AM_CFLAGS)
libtar_a_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/lib/tar/padd_file.c b/lib/tar/padd_file.c
index 471370d..f58cfbf 100644
--- a/lib/tar/padd_file.c
+++ b/lib/tar/padd_file.c
@@ -25,8 +25,8 @@ int padd_file(int outfd, sqfs_u64 size)
if (buffer == NULL)
goto fail_errno;
- if (write_data("padding output file to block size",
- outfd, buffer, padd_sz)) {
+ if (write_retry("padding output file to block size",
+ outfd, buffer, padd_sz)) {
goto out;
}
diff --git a/lib/tar/write_header.c b/lib/tar/write_header.c
index 14802c0..84aa2d3 100644
--- a/lib/tar/write_header.c
+++ b/lib/tar/write_header.c
@@ -88,7 +88,7 @@ static int write_header(int fd, const struct stat *sb, const char *name,
update_checksum(&hdr);
- return write_data("writing tar header record", fd, &hdr, sizeof(hdr));
+ return write_retry("writing tar header record", fd, &hdr, sizeof(hdr));
}
static int write_gnu_header(int fd, const struct stat *orig,
@@ -104,8 +104,8 @@ static int write_gnu_header(int fd, const struct stat *orig,
if (write_header(fd, &sb, name, NULL, type))
return -1;
- if (write_data("writing GNU extension header",
- fd, payload, payload_len)) {
+ if (write_retry("writing GNU extension header",
+ fd, payload, payload_len)) {
return -1;
}
diff --git a/lib/util/write_data.c b/lib/tar/write_retry.c
index 8b4c00d..1ff1a7e 100644
--- a/lib/util/write_data.c
+++ b/lib/tar/write_retry.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-3.0-or-later */
/*
- * write_data.c
+ * write_retry.c
*
* Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
*/
@@ -10,9 +10,9 @@
#include <errno.h>
#include <stdio.h>
-#include "util.h"
+#include "tar.h"
-int write_data(const char *errstr, int fd, const void *data, size_t size)
+int write_retry(const char *errstr, int fd, const void *data, size_t size)
{
ssize_t ret;
diff --git a/lib/util/Makemodule.am b/lib/util/Makemodule.am
index 8dce70c..77f6c05 100644
--- a/lib/util/Makemodule.am
+++ b/lib/util/Makemodule.am
@@ -1,4 +1,4 @@
-libutil_la_SOURCES = lib/util/write_data.c include/util.h include/compat.h
+libutil_la_SOURCES = include/util.h include/compat.h
libutil_la_SOURCES += lib/util/str_table.c include/str_table.h
libutil_la_SOURCES += lib/util/alloc.c lib/util/canonicalize_name.c
libutil_la_CFLAGS = $(AM_CFLAGS)