1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-14 04:58:28 +03:00

importd: trivial modernizations

This commit is contained in:
Lennart Poettering 2024-02-16 18:20:36 +01:00
parent 09232207b1
commit b37ec1e7ca
6 changed files with 17 additions and 18 deletions

View File

@ -210,7 +210,7 @@ static int help(int argc, char *argv[], void *userdata) {
"\n%2$sOptions:%3$s\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --format=FORMAT Select format\n\n",
" --format=FORMAT Select format\n",
program_invocation_short_name,
ansi_underline(),
ansi_normal(),
@ -288,8 +288,7 @@ static int run(int argc, char *argv[]) {
int r;
setlocale(LC_ALL, "");
log_parse_environment();
log_open();
log_setup();
r = parse_argv(argc, argv);
if (r <= 0)

View File

@ -379,8 +379,7 @@ static int run(int argc, char *argv[]) {
int r;
setlocale(LC_ALL, "");
log_parse_environment();
log_open();
log_setup();
r = parse_argv(argc, argv);
if (r <= 0)

View File

@ -160,7 +160,7 @@ static int import_tar(int argc, char *argv[], void *userdata) {
fd = open_source(path, normalized, &open_fd);
if (fd < 0)
return r;
return fd;
r = import_allocate_event_with_signals(&event);
if (r < 0)
@ -475,8 +475,7 @@ static int run(int argc, char *argv[]) {
int r;
setlocale(LC_ALL, "");
log_parse_environment();
log_open();
log_setup();
parse_env();

View File

@ -108,11 +108,11 @@ struct Manager {
static const char* const transfer_type_table[_TRANSFER_TYPE_MAX] = {
[TRANSFER_IMPORT_TAR] = "import-tar",
[TRANSFER_IMPORT_RAW] = "import-raw",
[TRANSFER_IMPORT_FS] = "import-fs",
[TRANSFER_IMPORT_FS] = "import-fs",
[TRANSFER_EXPORT_TAR] = "export-tar",
[TRANSFER_EXPORT_RAW] = "export-raw",
[TRANSFER_PULL_TAR] = "pull-tar",
[TRANSFER_PULL_RAW] = "pull-raw",
[TRANSFER_PULL_TAR] = "pull-tar",
[TRANSFER_PULL_RAW] = "pull-raw",
};
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(transfer_type, TransferType);
@ -391,7 +391,7 @@ static int transfer_start(Transfer *t) {
NULL, /* local */
NULL
};
unsigned k = 0;
size_t k = 0;
/* Child */

View File

@ -219,7 +219,7 @@ static int tar_pull_determine_path(
static int tar_pull_make_local_copy(TarPull *i) {
_cleanup_(rm_rf_subvolume_and_freep) char *t = NULL;
const char *p;
_cleanup_free_ char *p = NULL;
int r;
assert(i);
@ -230,7 +230,9 @@ static int tar_pull_make_local_copy(TarPull *i) {
assert(i->final_path);
p = prefix_roota(i->image_root, i->local);
p = path_join(i->image_root, i->local);
if (!p)
return log_oom();
r = tempfn_random(p, NULL, &t);
if (r < 0)

View File

@ -213,7 +213,8 @@ static int pull_raw(int argc, char *argv[], void *userdata) {
if (!FLAGS_SET(arg_pull_flags, PULL_SYNC))
log_info("File system synchronization on completion is off.");
r = raw_pull_new(&pull, event, arg_image_root, on_raw_finished, event);
r = raw_pull_new(&pull, event, arg_image_root, on_raw_finished, event);
if (r < 0)
return log_error_errno(r, "Failed to allocate puller: %m");
@ -255,7 +256,7 @@ static int help(int argc, char *argv[], void *userdata) {
" --roothash-signature=BOOL\n"
" Download root hash signature file with image\n"
" --verity=BOOL Download verity file with image\n"
" --image-root=PATH Image root directory\n\n"
" --image-root=PATH Image root directory\n"
" --read-only Create a read-only image\n"
" --direct Download directly to specified file\n"
" --btrfs-subvol=BOOL Controls whether to create a btrfs subvolume\n"
@ -539,8 +540,7 @@ static int run(int argc, char *argv[]) {
int r;
setlocale(LC_ALL, "");
log_parse_environment();
log_open();
log_setup();
parse_env();