summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-09-05 16:15:09 +0200
committerMike Yuan <me@yhndnzj.com>2023-09-07 14:30:44 +0200
commite22c60a9d5dfc5f0b260c7906f3546aef2925998 (patch)
treedb787a77716e96a31cabe7e99485f866a7c17e93 /src/import
parentMerge pull request #28957 from yuwata/core-mount-set-dirty-on-umount (diff)
downloadsystemd-e22c60a9d5dfc5f0b260c7906f3546aef2925998.tar.xz
systemd-e22c60a9d5dfc5f0b260c7906f3546aef2925998.zip
io-util: introduce loop_write_full that takes a timeout
Also drop do_poll as the use case is covered by timeout.
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-raw.c2
-rw-r--r--src/import/import-tar.c2
-rw-r--r--src/import/pull-common.c4
-rw-r--r--src/import/pull-job.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index 4c9a30292b..feb6ac1bdd 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -378,7 +378,7 @@ static int raw_import_write(const void *p, size_t sz, void *userdata) {
if ((size_t) n < sz)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short write");
} else {
- r = loop_write(i->output_fd, p, sz, false);
+ r = loop_write(i->output_fd, p, sz);
if (r < 0)
return log_error_errno(r, "Failed to write file: %m");
}
diff --git a/src/import/import-tar.c b/src/import/import-tar.c
index ff32ae4e59..8c18457816 100644
--- a/src/import/import-tar.c
+++ b/src/import/import-tar.c
@@ -250,7 +250,7 @@ static int tar_import_write(const void *p, size_t sz, void *userdata) {
TarImport *i = userdata;
int r;
- r = loop_write(i->tar_fd, p, sz, false);
+ r = loop_write(i->tar_fd, p, sz);
if (r < 0)
return r;
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index 3b80e64b32..a3d4bc8433 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -400,7 +400,7 @@ static int verify_gpg(
if (sig_file < 0)
return log_error_errno(errno, "Failed to create temporary file: %m");
- r = loop_write(sig_file, signature, signature_size, false);
+ r = loop_write(sig_file, signature, signature_size);
if (r < 0) {
log_error_errno(r, "Failed to write to temporary file: %m");
goto finish;
@@ -465,7 +465,7 @@ static int verify_gpg(
gpg_pipe[0] = safe_close(gpg_pipe[0]);
- r = loop_write(gpg_pipe[1], payload, payload_size, false);
+ r = loop_write(gpg_pipe[1], payload, payload_size);
if (r < 0) {
log_error_errno(r, "Failed to write to pipe: %m");
goto finish;
diff --git a/src/import/pull-job.c b/src/import/pull-job.c
index 8dd8ac0915..d05bf3cd49 100644
--- a/src/import/pull-job.c
+++ b/src/import/pull-job.c
@@ -336,7 +336,7 @@ static int pull_job_write_uncompressed(const void *p, size_t sz, void *userdata)
if ((size_t) n < sz)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short write");
} else {
- r = loop_write(j->disk_fd, p, sz, false);
+ r = loop_write(j->disk_fd, p, sz);
if (r < 0)
return log_error_errno(r, "Failed to write file: %m");
}