From: Daan De Meyer Date: Wed, 21 May 2025 14:32:52 +0000 (+0200) Subject: import: Clean up headers X-Git-Tag: v258-rc1~544 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9412e9e97b991f8b9ccda3a7ce7f3671cc9c50e5;p=thirdparty%2Fsystemd.git import: Clean up headers Split out of #37344. --- diff --git a/src/import/curl-util.c b/src/import/curl-util.c index c8217bd4d25..82a1fc132ac 100644 --- a/src/import/curl-util.c +++ b/src/import/curl-util.c @@ -1,14 +1,14 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include -#include +#include "sd-event.h" #include "alloc-util.h" #include "curl-util.h" #include "fd-util.h" -#include "locale-util.h" +#include "hashmap.h" #include "log.h" #include "string-util.h" +#include "time-util.h" #include "version.h" static void curl_glue_check_finished(CurlGlue *g) { diff --git a/src/import/curl-util.h b/src/import/curl-util.h index cef0b26986d..abba49044b3 100644 --- a/src/import/curl-util.h +++ b/src/import/curl-util.h @@ -2,16 +2,12 @@ #pragma once #include -#include -#include "sd-event.h" - -#include "hashmap.h" -#include "time-util.h" +#include "forward.h" typedef struct CurlGlue CurlGlue; -struct CurlGlue { +typedef struct CurlGlue { sd_event *event; CURLM *curl; sd_event_source *timer; @@ -20,7 +16,7 @@ struct CurlGlue { void (*on_finished)(CurlGlue *g, CURL *curl, CURLcode code); void *userdata; -}; +} CurlGlue; int curl_glue_new(CurlGlue **glue, sd_event *event); CurlGlue* curl_glue_unref(CurlGlue *glue); diff --git a/src/import/export-raw.c b/src/import/export-raw.c index cdc7cf1782d..787d230d2ff 100644 --- a/src/import/export-raw.c +++ b/src/import/export-raw.c @@ -3,26 +3,26 @@ #include #include "sd-daemon.h" +#include "sd-event.h" #include "alloc-util.h" -#include "btrfs-util.h" #include "copy.h" #include "export-raw.h" #include "fd-util.h" #include "format-util.h" #include "fs-util.h" -#include "import-common.h" #include "log.h" -#include "missing_fcntl.h" #include "pretty-print.h" #include "ratelimit.h" #include "stat-util.h" #include "string-util.h" +#include "terminal-util.h" +#include "time-util.h" #include "tmpfile-util.h" #define COPY_BUFFER_SIZE (16*1024) -struct RawExport { +typedef struct RawExport { sd_event *event; RawExportFinished on_finished; @@ -52,7 +52,7 @@ struct RawExport { bool eof; bool tried_reflink; bool tried_sendfile; -}; +} RawExport; RawExport *raw_export_unref(RawExport *e) { if (!e) diff --git a/src/import/export-raw.h b/src/import/export-raw.h index 7c952626476..9bac076b35b 100644 --- a/src/import/export-raw.h +++ b/src/import/export-raw.h @@ -1,10 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "sd-event.h" - +#include "forward.h" #include "import-compress.h" -#include "memory-util.h" typedef struct RawExport RawExport; diff --git a/src/import/export-tar.c b/src/import/export-tar.c index a2af379bf8a..5b907769a07 100644 --- a/src/import/export-tar.c +++ b/src/import/export-tar.c @@ -1,22 +1,28 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#include + #include "sd-daemon.h" +#include "sd-event.h" #include "alloc-util.h" #include "btrfs-util.h" #include "export-tar.h" #include "fd-util.h" +#include "format-util.h" #include "import-common.h" #include "log.h" #include "pretty-print.h" #include "process-util.h" #include "ratelimit.h" #include "string-util.h" +#include "terminal-util.h" +#include "time-util.h" #include "tmpfile-util.h" #define COPY_BUFFER_SIZE (16*1024) -struct TarExport { +typedef struct TarExport { sd_event *event; TarExportFinished on_finished; @@ -49,7 +55,7 @@ struct TarExport { bool eof; bool tried_splice; -}; +} TarExport; TarExport *tar_export_unref(TarExport *e) { if (!e) diff --git a/src/import/export-tar.h b/src/import/export-tar.h index 729b9ef7364..f261c0c8d24 100644 --- a/src/import/export-tar.h +++ b/src/import/export-tar.h @@ -1,10 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "sd-event.h" - +#include "forward.h" #include "import-compress.h" -#include "memory-util.h" typedef struct TarExport TarExport; diff --git a/src/import/export.c b/src/import/export.c index 0ee2a1db71d..6f035bf96ed 100644 --- a/src/import/export.c +++ b/src/import/export.c @@ -4,7 +4,6 @@ #include #include "sd-event.h" -#include "sd-id128.h" #include "alloc-util.h" #include "ansi-color.h" @@ -13,14 +12,12 @@ #include "export-raw.h" #include "export-tar.h" #include "fd-util.h" -#include "fs-util.h" -#include "hostname-util.h" #include "import-common.h" -#include "import-util.h" +#include "log.h" #include "main-func.h" +#include "runtime-scope.h" #include "signal-util.h" #include "string-util.h" -#include "terminal-util.h" #include "verbs.h" static ImportCompressType arg_compress = IMPORT_COMPRESS_UNKNOWN; @@ -56,7 +53,7 @@ static void on_tar_finished(TarExport *export, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - sd_event_exit(event, abs(error)); + sd_event_exit(event, ABS(error)); } static int export_tar(int argc, char *argv[], void *userdata) { @@ -129,7 +126,7 @@ static void on_raw_finished(RawExport *export, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - sd_event_exit(event, abs(error)); + sd_event_exit(event, ABS(error)); } static int export_raw(int argc, char *argv[], void *userdata) { diff --git a/src/import/import-common.c b/src/import/import-common.c index be09c766cb4..bab81d596f9 100644 --- a/src/import/import-common.c +++ b/src/import/import-common.c @@ -1,25 +1,22 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include -#include #include #include +#include "sd-event.h" + #include "alloc-util.h" -#include "btrfs-util.h" #include "capability-util.h" -#include "chattr-util.h" #include "dirent-util.h" #include "fd-util.h" #include "fileio.h" #include "fs-util.h" -#include "hostname-util.h" #include "import-common.h" #include "log.h" #include "os-util.h" #include "process-util.h" #include "selinux-util.h" -#include "signal-util.h" #include "stat-util.h" #include "tmpfile-util.h" diff --git a/src/import/import-common.h b/src/import/import-common.h index d7fb77a0700..bb7d5614f01 100644 --- a/src/import/import-common.h +++ b/src/import/import-common.h @@ -1,11 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include -#include -#include - -#include "sd-event.h" +#include "forward.h" typedef enum ImportFlags { /* Public Flags (i.e. accessible via D-Bus, must stay stable! */ diff --git a/src/import/import-compress.c b/src/import/import-compress.c index f6385c6b036..012fd2c3edd 100644 --- a/src/import/import-compress.c +++ b/src/import/import-compress.c @@ -1,8 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "assert-util.h" +#include +#include + #include "import-compress.h" -#include "log.h" #include "string-table.h" void import_compress_free(ImportCompress *c) { diff --git a/src/import/import-compress.h b/src/import/import-compress.h index 160d9e62a6e..ea14038a4ff 100644 --- a/src/import/import-compress.h +++ b/src/import/import-compress.h @@ -1,20 +1,16 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include - #if HAVE_BZIP2 #include #endif #include -#include #include #if HAVE_ZSTD #include -#include #endif -#include "macro.h" +#include "forward.h" typedef enum ImportCompressType { IMPORT_COMPRESS_UNKNOWN, diff --git a/src/import/import-fs.c b/src/import/import-fs.c index 2c9f5ba146a..6a364dc02f8 100644 --- a/src/import/import-fs.c +++ b/src/import/import-fs.c @@ -10,19 +10,20 @@ #include "discover-image.h" #include "fd-util.h" #include "format-util.h" -#include "fs-util.h" -#include "hostname-util.h" #include "import-common.h" #include "import-util.h" #include "install-file.h" +#include "log.h" #include "main-func.h" #include "mkdir-label.h" #include "parse-argument.h" +#include "path-util.h" #include "ratelimit.h" #include "rm-rf.h" +#include "runtime-scope.h" #include "signal-util.h" #include "string-util.h" -#include "terminal-util.h" +#include "time-util.h" #include "tmpfile-util.h" #include "verbs.h" diff --git a/src/import/import-generator.c b/src/import/import-generator.c index a442a2025fb..176ee7cb8a2 100644 --- a/src/import/import-generator.c +++ b/src/import/import-generator.c @@ -6,6 +6,7 @@ #include "creds-util.h" #include "discover-image.h" #include "efivars.h" +#include "errno-util.h" #include "extract-word.h" #include "fd-util.h" #include "fileio.h" @@ -14,9 +15,10 @@ #include "initrd-util.h" #include "json-util.h" #include "parse-util.h" +#include "path-util.h" #include "proc-cmdline.h" -#include "special.h" #include "specifier.h" +#include "string-util.h" #include "unit-name.h" #include "web-util.h" diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 3685904e03d..dc1a4b1c623 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -1,15 +1,15 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#include + #include "sd-daemon.h" #include "sd-event.h" #include "alloc-util.h" -#include "btrfs-util.h" #include "copy.h" #include "fd-util.h" #include "format-util.h" #include "fs-util.h" -#include "hostname-util.h" #include "import-common.h" #include "import-compress.h" #include "import-raw.h" @@ -17,18 +17,16 @@ #include "install-file.h" #include "io-util.h" #include "log.h" -#include "machine-pool.h" -#include "missing_fs.h" #include "mkdir-label.h" -#include "path-util.h" #include "pretty-print.h" #include "qcow2-util.h" #include "ratelimit.h" -#include "rm-rf.h" #include "string-util.h" +#include "terminal-util.h" +#include "time-util.h" #include "tmpfile-util.h" -struct RawImport { +typedef struct RawImport { sd_event *event; char *image_root; @@ -63,7 +61,7 @@ struct RawImport { uint64_t offset; uint64_t size_max; -}; +} RawImport; RawImport* raw_import_unref(RawImport *i) { if (!i) diff --git a/src/import/import-raw.h b/src/import/import-raw.h index 1feed79a534..9b711624090 100644 --- a/src/import/import-raw.h +++ b/src/import/import-raw.h @@ -1,10 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "sd-event.h" - +#include "forward.h" #include "import-common.h" -#include "memory-util.h" typedef struct RawImport RawImport; diff --git a/src/import/import-tar.c b/src/import/import-tar.c index ac6925f30bd..b4b9b8dc997 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -1,16 +1,15 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#include + #include "sd-daemon.h" #include "sd-event.h" #include "alloc-util.h" #include "btrfs-util.h" -#include "copy.h" #include "errno-util.h" #include "fd-util.h" -#include "fileio.h" -#include "fs-util.h" -#include "hostname-util.h" +#include "format-util.h" #include "import-common.h" #include "import-compress.h" #include "import-tar.h" @@ -18,19 +17,18 @@ #include "install-file.h" #include "io-util.h" #include "log.h" -#include "machine-pool.h" -#include "missing_fs.h" #include "mkdir-label.h" #include "path-util.h" #include "pretty-print.h" #include "process-util.h" -#include "qcow2-util.h" #include "ratelimit.h" #include "rm-rf.h" #include "string-util.h" +#include "terminal-util.h" +#include "time-util.h" #include "tmpfile-util.h" -struct TarImport { +typedef struct TarImport { sd_event *event; char *image_root; @@ -63,7 +61,7 @@ struct TarImport { unsigned last_percent; RateLimit progress_ratelimit; -}; +} TarImport; TarImport* tar_import_unref(TarImport *i) { if (!i) diff --git a/src/import/import-tar.h b/src/import/import-tar.h index d90ba1199ad..90d432b1e00 100644 --- a/src/import/import-tar.h +++ b/src/import/import-tar.h @@ -1,10 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "sd-event.h" - +#include "forward.h" #include "import-common.h" -#include "memory-util.h" typedef struct TarImport TarImport; diff --git a/src/import/import.c b/src/import/import.c index 6568c591560..72757d2ec70 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -4,7 +4,6 @@ #include #include "sd-event.h" -#include "sd-id128.h" #include "alloc-util.h" #include "ansi-color.h" @@ -12,18 +11,18 @@ #include "discover-image.h" #include "env-util.h" #include "fd-util.h" -#include "fs-util.h" -#include "hostname-util.h" #include "import-raw.h" #include "import-tar.h" #include "import-util.h" #include "io-util.h" +#include "log.h" #include "main-func.h" #include "parse-argument.h" #include "parse-util.h" +#include "path-util.h" +#include "runtime-scope.h" #include "signal-util.h" #include "string-util.h" -#include "terminal-util.h" #include "verbs.h" static const char *arg_image_root = NULL; @@ -133,7 +132,7 @@ static void on_tar_finished(TarImport *import, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - sd_event_exit(event, abs(error)); + sd_event_exit(event, ABS(error)); } static int import_tar(int argc, char *argv[], void *userdata) { @@ -202,7 +201,7 @@ static void on_raw_finished(RawImport *import, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - sd_event_exit(event, abs(error)); + sd_event_exit(event, ABS(error)); } static int import_raw(int argc, char *argv[], void *userdata) { diff --git a/src/import/importctl.c b/src/import/importctl.c index 97a95d3612a..9a8c6f08a1f 100644 --- a/src/import/importctl.c +++ b/src/import/importctl.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include +#include #include "sd-bus.h" +#include "sd-event.h" #include "alloc-util.h" #include "build.h" @@ -12,12 +14,9 @@ #include "discover-image.h" #include "fd-util.h" #include "format-table.h" -#include "hostname-util.h" #include "import-common.h" #include "import-util.h" -#include "locale-util.h" #include "log.h" -#include "macro.h" #include "main-func.h" #include "os-util.h" #include "pager.h" @@ -26,9 +25,10 @@ #include "path-util.h" #include "polkit-agent.h" #include "pretty-print.h" -#include "signal-util.h" -#include "sort-util.h" +#include "runtime-scope.h" #include "string-table.h" +#include "string-util.h" +#include "strv.h" #include "verbs.h" #include "web-util.h" diff --git a/src/import/importd.c b/src/import/importd.c index 45b5434ca06..4936bd80312 100644 --- a/src/import/importd.c +++ b/src/import/importd.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include -#include +#include #include "sd-bus.h" #include "sd-varlink.h" @@ -11,6 +10,7 @@ #include "bus-common-errors.h" #include "bus-get-properties.h" #include "bus-log-control-api.h" +#include "bus-object.h" #include "bus-polkit.h" #include "bus-util.h" #include "common-signal.h" @@ -21,33 +21,31 @@ #include "event-util.h" #include "fd-util.h" #include "float.h" -#include "hostname-util.h" +#include "hashmap.h" #include "import-common.h" #include "import-util.h" #include "json-util.h" #include "machine-pool.h" #include "main-func.h" -#include "mkdir-label.h" #include "notify-recv.h" #include "os-util.h" #include "parse-util.h" -#include "path-util.h" #include "percent-util.h" +#include "pidref.h" #include "process-util.h" +#include "runtime-scope.h" #include "service-util.h" +#include "set.h" #include "signal-util.h" -#include "socket-util.h" #include "stat-util.h" #include "string-table.h" #include "strv.h" #include "syslog-util.h" -#include "user-util.h" #include "varlink-io.systemd.Import.h" #include "varlink-io.systemd.service.h" #include "varlink-util.h" #include "web-util.h" -typedef struct Transfer Transfer; typedef struct Manager Manager; typedef enum TransferType { @@ -62,7 +60,7 @@ typedef enum TransferType { _TRANSFER_TYPE_INVALID = -EINVAL, } TransferType; -struct Transfer { +typedef struct Transfer { Manager *manager; uint32_t id; @@ -96,9 +94,9 @@ struct Transfer { int stdout_fd; Set *varlink_subscribed; -}; +} Transfer; -struct Manager { +typedef struct Manager { sd_event *event; sd_bus *bus; sd_varlink_server *varlink_server; @@ -114,7 +112,7 @@ struct Manager { bool use_btrfs_quota; RuntimeScope runtime_scope; /* for now: always RUNTIME_SCOPE_SYSTEM */ -}; +} Manager; #define TRANSFERS_MAX 64 diff --git a/src/import/pull-common.c b/src/import/pull-common.c index 76b3cf81ac0..67ed640a6f4 100644 --- a/src/import/pull-common.c +++ b/src/import/pull-common.c @@ -1,24 +1,20 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include +#include "sd-id128.h" #include "alloc-util.h" -#include "btrfs-util.h" -#include "capability-util.h" -#include "copy.h" #include "dirent-util.h" -#include "discover-image.h" #include "escape.h" #include "fd-util.h" -#include "hostname-util.h" #include "io-util.h" +#include "log.h" #include "memory-util.h" +#include "os-util.h" #include "path-util.h" #include "process-util.h" #include "pull-common.h" #include "pull-job.h" #include "rm-rf.h" -#include "signal-util.h" #include "siphash24.h" #include "string-util.h" #include "strv.h" diff --git a/src/import/pull-common.h b/src/import/pull-common.h index 5a1bac19a1e..455b8395d2c 100644 --- a/src/import/pull-common.h +++ b/src/import/pull-common.h @@ -1,12 +1,14 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include - +#include "forward.h" #include "import-common.h" #include "import-util.h" #include "pull-job.h" +typedef struct CurlGlue CurlGlue; +typedef struct PullJob PullJob; + int pull_find_old_etags(const char *url, const char *root, int dt, const char *prefix, const char *suffix, char ***etags); int pull_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret); diff --git a/src/import/pull-job.c b/src/import/pull-job.c index d29fa439665..36b4c9ee182 100644 --- a/src/import/pull-job.c +++ b/src/import/pull-job.c @@ -8,16 +8,16 @@ #include "fd-util.h" #include "format-util.h" #include "hexdecoct.h" -#include "import-util.h" #include "io-util.h" #include "log.h" -#include "machine-pool.h" #include "parse-util.h" #include "pull-common.h" #include "pull-job.h" +#include "curl-util.h" #include "string-util.h" #include "strv.h" #include "sync-util.h" +#include "time-util.h" #include "xattr-util.h" void pull_job_close_disk_fd(PullJob *j) { diff --git a/src/import/pull-job.h b/src/import/pull-job.h index 6e471ffc1ff..504185aaa9c 100644 --- a/src/import/pull-job.h +++ b/src/import/pull-job.h @@ -1,12 +1,14 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include -#include "curl-util.h" +#include "forward.h" #include "import-compress.h" #include "openssl-util.h" +typedef struct CurlGlue CurlGlue; typedef struct PullJob PullJob; typedef void (*PullJobFinished)(PullJob *job); @@ -27,7 +29,7 @@ typedef enum PullJobState { #define PULL_JOB_IS_COMPLETE(j) (IN_SET((j)->state, PULL_JOB_DONE, PULL_JOB_FAILED)) -struct PullJob { +typedef struct PullJob { PullJobState state; int error; @@ -77,7 +79,7 @@ struct PullJob { char *checksum; bool sync; bool force_memory; -}; +} PullJob; int pull_job_new(PullJob **job, const char *url, CurlGlue *glue, void *userdata); PullJob* pull_job_unref(PullJob *job); diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index 400a9d6adf7..6ba8f6cdc90 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -1,34 +1,24 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include -#include - #include "sd-daemon.h" +#include "sd-event.h" #include "alloc-util.h" -#include "btrfs-util.h" #include "copy.h" #include "curl-util.h" #include "fd-util.h" #include "fs-util.h" -#include "hostname-util.h" #include "import-common.h" #include "import-util.h" #include "install-file.h" #include "log.h" -#include "macro.h" -#include "missing_fs.h" #include "mkdir-label.h" -#include "path-util.h" #include "pull-common.h" #include "pull-job.h" #include "pull-raw.h" #include "qcow2-util.h" -#include "rm-rf.h" #include "string-util.h" -#include "strv.h" #include "tmpfile-util.h" -#include "utf8.h" #include "web-util.h" typedef enum RawProgress { @@ -39,7 +29,7 @@ typedef enum RawProgress { RAW_COPYING, } RawProgress; -struct RawPull { +typedef struct RawPull { sd_event *event; CurlGlue *glue; @@ -79,7 +69,7 @@ struct RawPull { char *verity_temp_path; char *checksum; -}; +} RawPull; RawPull* raw_pull_unref(RawPull *i) { if (!i) diff --git a/src/import/pull-raw.h b/src/import/pull-raw.h index e50ba326f65..8ca65795903 100644 --- a/src/import/pull-raw.h +++ b/src/import/pull-raw.h @@ -1,11 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "sd-event.h" - +#include "forward.h" +#include "import-common.h" #include "import-util.h" -#include "macro.h" -#include "pull-common.h" typedef struct RawPull RawPull; diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index 10f3ea0497a..b4b5c690a0f 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -1,23 +1,20 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include -#include +#include #include "sd-daemon.h" +#include "sd-event.h" #include "alloc-util.h" #include "btrfs-util.h" #include "copy.h" #include "curl-util.h" #include "errno-util.h" -#include "fd-util.h" #include "fs-util.h" -#include "hostname-util.h" #include "import-common.h" #include "import-util.h" #include "install-file.h" #include "log.h" -#include "macro.h" #include "mkdir-label.h" #include "path-util.h" #include "process-util.h" @@ -26,10 +23,7 @@ #include "pull-tar.h" #include "rm-rf.h" #include "string-util.h" -#include "strv.h" #include "tmpfile-util.h" -#include "user-util.h" -#include "utf8.h" #include "web-util.h" typedef enum TarProgress { @@ -39,7 +33,7 @@ typedef enum TarProgress { TAR_COPYING, } TarProgress; -struct TarPull { +typedef struct TarPull { sd_event *event; CurlGlue *glue; @@ -66,7 +60,7 @@ struct TarPull { char *settings_temp_path; char *checksum; -}; +} TarPull; TarPull* tar_pull_unref(TarPull *i) { if (!i) diff --git a/src/import/pull-tar.h b/src/import/pull-tar.h index 1a5b740463c..627cb0bcc8c 100644 --- a/src/import/pull-tar.h +++ b/src/import/pull-tar.h @@ -1,11 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "sd-event.h" - +#include "forward.h" +#include "import-common.h" #include "import-util.h" -#include "macro.h" -#include "pull-common.h" typedef struct TarPull TarPull; diff --git a/src/import/pull.c b/src/import/pull.c index b2614fa8f56..41193e43971 100644 --- a/src/import/pull.c +++ b/src/import/pull.c @@ -2,9 +2,9 @@ #include #include +#include #include "sd-event.h" -#include "sd-id128.h" #include "alloc-util.h" #include "ansi-color.h" @@ -12,18 +12,19 @@ #include "discover-image.h" #include "env-util.h" #include "hexdecoct.h" -#include "hostname-util.h" #include "import-common.h" #include "import-util.h" #include "io-util.h" +#include "log.h" #include "main-func.h" #include "parse-argument.h" #include "parse-util.h" +#include "path-util.h" #include "pull-raw.h" #include "pull-tar.h" +#include "runtime-scope.h" #include "signal-util.h" #include "string-util.h" -#include "terminal-util.h" #include "verbs.h" #include "web-util.h" @@ -109,7 +110,7 @@ static void on_tar_finished(TarPull *pull, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - sd_event_exit(event, abs(error)); + sd_event_exit(event, ABS(error)); } static int pull_tar(int argc, char *argv[], void *userdata) { @@ -179,7 +180,7 @@ static void on_raw_finished(RawPull *pull, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - sd_event_exit(event, abs(error)); + sd_event_exit(event, ABS(error)); } static int pull_raw(int argc, char *argv[], void *userdata) { diff --git a/src/import/qcow2-util.c b/src/import/qcow2-util.c index 6c186f6128f..77298bcbe29 100644 --- a/src/import/qcow2-util.c +++ b/src/import/qcow2-util.c @@ -3,8 +3,7 @@ #include #include "alloc-util.h" -#include "assert-util.h" -#include "btrfs-util.h" +#include "copy.h" #include "qcow2-util.h" #include "sparse-endian.h" diff --git a/src/import/test-qcow2.c b/src/import/test-qcow2.c index 88932071bc4..26b0685c317 100644 --- a/src/import/test-qcow2.c +++ b/src/import/test-qcow2.c @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include -#include -#include #include "fd-util.h" #include "log.h"