tree-wide: several fixlets for log message and comment (#38263)
This commit is contained in:
@@ -82,7 +82,7 @@ int verb_unit_shell(int argc, char *argv[], void *userdata) {
|
||||
"(unit-shell-ns)",
|
||||
"(unit-shell)",
|
||||
/* except_fds= */ NULL,
|
||||
/* n_except_fds */ 0,
|
||||
/* n_except_fds= */ 0,
|
||||
FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGKILL,
|
||||
pidns_fd,
|
||||
mntns_fd,
|
||||
|
||||
@@ -291,7 +291,7 @@ static int files_add(
|
||||
|
||||
if (need_stat) {
|
||||
/* If we need to have stat, skip the entry. */
|
||||
log_debug_errno(SYNTHETIC_ERRNO(ENOENT), "Failed to chase '%s/%s', ignoring: %m",
|
||||
log_debug_errno(SYNTHETIC_ERRNO(ENOENT), "Failed to chase '%s/%s', ignoring.",
|
||||
root, skip_leading_slash(original_path));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1777,7 +1777,7 @@ int vt_restore(int fd) {
|
||||
assert(fd >= 0);
|
||||
|
||||
if (!isatty_safe(fd))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOTTY), "Asked to restore the VT for an fd that does not refer to a terminal: %m");
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOTTY), "Asked to restore the VT for an fd that does not refer to a terminal.");
|
||||
|
||||
if (ioctl(fd, KDSETMODE, KD_TEXT) < 0)
|
||||
RET_GATHER(ret, log_debug_errno(errno, "Failed to set VT to text mode, ignoring: %m"));
|
||||
@@ -1804,7 +1804,7 @@ int vt_release(int fd, bool restore) {
|
||||
* VT-switching modes. */
|
||||
|
||||
if (!isatty_safe(fd))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOTTY), "Asked to release the VT for an fd that does not refer to a terminal: %m");
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ENOTTY), "Asked to release the VT for an fd that does not refer to a terminal.");
|
||||
|
||||
if (ioctl(fd, VT_RELDISP, 1) < 0)
|
||||
return -errno;
|
||||
|
||||
@@ -236,7 +236,7 @@ static int acquire_boot_count_path(
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to extract filename from LoaderBootCountPath '%s': %m", path);
|
||||
if (r == 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EADDRNOTAVAIL), "LoaderBootCountPath '%s' refers to the root directory: %m", path);
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EADDRNOTAVAIL), "LoaderBootCountPath '%s' refers to the root directory.", path);
|
||||
if (strlen(last) > (size_t) r)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EISDIR), "LoaderBootCountPath '%s' refers to directory path, refusing.", path);
|
||||
|
||||
|
||||
+4
-4
@@ -366,8 +366,8 @@ static void pe_locate_sections(
|
||||
n_section_table,
|
||||
section_names,
|
||||
validate_base,
|
||||
/* device_base */ NULL,
|
||||
/* device */ NULL,
|
||||
/* device_table = */ NULL,
|
||||
/* device = */ NULL,
|
||||
sections);
|
||||
|
||||
/* It doesn't make sense not to provide validate_base here */
|
||||
@@ -386,8 +386,8 @@ static void pe_locate_sections(
|
||||
n_section_table,
|
||||
hwid_section_names,
|
||||
validate_base,
|
||||
/* device_table */ NULL,
|
||||
/* device */ NULL,
|
||||
/* device_table = */ NULL,
|
||||
/* device = */ NULL,
|
||||
hwids_section);
|
||||
|
||||
if (PE_SECTION_VECTOR_IS_SET(hwids_section)) {
|
||||
|
||||
@@ -120,7 +120,7 @@ EFI_STATUS secure_boot_enroll_at(EFI_FILE *root_dir, const char16_t *path, bool
|
||||
|
||||
err = open_directory(root_dir, path, &dir);
|
||||
if (err != EFI_SUCCESS)
|
||||
return log_error_status(err, "Failed opening keys directory %ls: %m", path);
|
||||
return log_error_status(err, "Failed to open keys directory %ls: %m", path);
|
||||
|
||||
struct {
|
||||
const char16_t *name;
|
||||
@@ -140,7 +140,7 @@ EFI_STATUS secure_boot_enroll_at(EFI_FILE *root_dir, const char16_t *path, bool
|
||||
FOREACH_ELEMENT(sb_var, sb_vars) {
|
||||
err = file_read(dir, sb_var->filename, 0, 0, &sb_var->buffer, &sb_var->size);
|
||||
if (err != EFI_SUCCESS && sb_var->required) {
|
||||
log_error_status(err, "Failed reading file %ls\\%ls: %m", path, sb_var->filename);
|
||||
log_error_status(err, "Failed to read file %ls\\%ls: %m", path, sb_var->filename);
|
||||
goto out_deallocate;
|
||||
}
|
||||
if (streq16(sb_var->name, u"PK") && sb_var->size > 20) {
|
||||
@@ -161,7 +161,7 @@ EFI_STATUS secure_boot_enroll_at(EFI_FILE *root_dir, const char16_t *path, bool
|
||||
}
|
||||
|
||||
if (need_custom_mode && !custom_mode_enabled()) {
|
||||
err = set_custom_mode(/* enable */ true);
|
||||
err = set_custom_mode(/* enable = */ true);
|
||||
if (err != EFI_SUCCESS) {
|
||||
log_error_status(err, "Failed to enable custom mode: %m");
|
||||
goto out_deallocate;
|
||||
|
||||
@@ -34,7 +34,7 @@ static int random_seed_verify_permissions(int fd, mode_t expected_type) {
|
||||
|
||||
if (((st.st_mode ^ expected_type) & S_IFMT) != 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EBADF),
|
||||
"Unexpected inode type when validating random seed access mode on %s: %m", full_path);
|
||||
"Unexpected inode type when validating random seed access mode on '%s'.", full_path);
|
||||
|
||||
if ((st.st_mode & 0007) == 0) /* All world bits are off? Then all is good */
|
||||
return 0;
|
||||
|
||||
@@ -211,7 +211,7 @@ int bpf_restrict_ifaces_supported(void) {
|
||||
|
||||
int bpf_restrict_ifaces_install(Unit *u) {
|
||||
return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EOPNOTSUPP),
|
||||
"restrict-interfaces: Failed to install; BPF programs built from source code are not supported: %m");
|
||||
"restrict-interfaces: Failed to install; BPF programs built from source code are not supported.");
|
||||
}
|
||||
|
||||
int bpf_restrict_ifaces_serialize(Unit *u, FILE *f, FDSet *fds) {
|
||||
|
||||
+1
-1
@@ -921,7 +921,7 @@ int bus_init_private(Manager *m) {
|
||||
r = sockaddr_un_set_path(&sa.un, p);
|
||||
}
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed set socket path for private bus: %m");
|
||||
return log_error_errno(r, "Failed to set socket path for private bus: %m");
|
||||
sa_len = r;
|
||||
|
||||
(void) sockaddr_un_unlink(&sa.un);
|
||||
|
||||
@@ -2791,7 +2791,7 @@ static int apply_exec_quotas(
|
||||
#define MAX_PROJ_ID_RETRIES 10
|
||||
for (unsigned attempt = 0;; attempt++) {
|
||||
if (attempt >= MAX_PROJ_ID_RETRIES)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBUSY), "Failed to generate unique project ID for %s: %m", target_dir);
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBUSY), "Failed to generate unique project ID for '%s'.", target_dir);
|
||||
|
||||
/* Check if project quotas are supported */
|
||||
struct dqblk req;
|
||||
@@ -4608,7 +4608,7 @@ static int setup_delegated_namespaces(
|
||||
exec_namespace_is_delegated(context, params, have_cap_sys_admin, CLONE_NEWPID) == delegate) {
|
||||
if (params->pidref_transport_fd < 0) {
|
||||
*reterr_exit_status = EXIT_NAMESPACE;
|
||||
return log_error_errno(SYNTHETIC_ERRNO(ENOTCONN), "PidRef socket is not set up: %m");
|
||||
return log_error_errno(SYNTHETIC_ERRNO(ENOTCONN), "PidRef socket is not set up.");
|
||||
}
|
||||
|
||||
/* If we had CAP_SYS_ADMIN prior to joining the user namespace, then we are privileged and don't need
|
||||
|
||||
+1
-1
@@ -1199,7 +1199,7 @@ void job_add_to_run_queue(Job *j) {
|
||||
|
||||
r = prioq_put(j->manager->run_queue, j, &j->run_queue_idx);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed put job in run queue, ignoring: %m");
|
||||
log_warning_errno(r, "Failed to put job in run queue, ignoring: %m");
|
||||
else
|
||||
j->in_run_queue = true;
|
||||
|
||||
|
||||
+1
-1
@@ -1421,7 +1421,7 @@ static int os_release_status(void) {
|
||||
}
|
||||
}
|
||||
|
||||
if (support_end && os_release_support_ended(support_end, /* quiet */ false, NULL) > 0)
|
||||
if (support_end && os_release_support_ended(support_end, /* quiet = */ false, /* ret_eol = */ NULL) > 0)
|
||||
/* pretty_name may include the version already, so we'll print the version only if we
|
||||
* have it and we're not using pretty_name. */
|
||||
status_printf(ANSI_HIGHLIGHT_RED " !! " ANSI_NORMAL, 0,
|
||||
|
||||
@@ -79,7 +79,7 @@ int mac_selinux_setup(bool *loaded_policy) {
|
||||
if (enforce > 0) {
|
||||
if (!initialized)
|
||||
return log_struct_errno(LOG_EMERG, SYNTHETIC_ERRNO(EIO),
|
||||
LOG_MESSAGE("Failed to load SELinux policy :%m"),
|
||||
LOG_MESSAGE("Failed to load SELinux policy."),
|
||||
LOG_MESSAGE_ID(SD_MESSAGE_SELINUX_FAILED_STR));
|
||||
|
||||
log_notice("Failed to load new SELinux policy. Continuing with old policy.");
|
||||
|
||||
+1
-1
@@ -393,7 +393,7 @@ static void service_extend_event_source_timeout(Service *s, sd_event_source *sou
|
||||
if (r < 0) {
|
||||
const char *desc;
|
||||
(void) sd_event_source_get_description(s->timer_event_source, &desc);
|
||||
log_unit_warning_errno(UNIT(s), r, "Failed to set timeout time for event source '%s', ignoring %m", strna(desc));
|
||||
log_unit_warning_errno(UNIT(s), r, "Failed to set timeout time for event source '%s', ignoring: %m", strna(desc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1578,7 +1578,7 @@ static int socket_address_listen_in_cgroup(
|
||||
|
||||
r = unit_setup_exec_runtime(UNIT(s));
|
||||
if (r < 0)
|
||||
return log_unit_error_errno(UNIT(s), r, "Failed acquire runtime: %m");
|
||||
return log_unit_error_errno(UNIT(s), r, "Failed to acquire runtime: %m");
|
||||
|
||||
if (s->exec_context.network_namespace_path &&
|
||||
s->exec_runtime &&
|
||||
|
||||
@@ -188,7 +188,7 @@ int enroll_password(
|
||||
}
|
||||
}
|
||||
|
||||
r = check_password_quality(new_password, /* old */ NULL, /* user */ NULL, &error);
|
||||
r = check_password_quality(new_password, /* old = */ NULL, /* user = */ NULL, &error);
|
||||
if (ERRNO_IS_NEG_NOT_SUPPORTED(r))
|
||||
log_warning("Password quality check is not supported, proceeding anyway.");
|
||||
else if (r < 0)
|
||||
|
||||
@@ -1556,7 +1556,7 @@ static int action_list_or_mtree_or_copy_or_make_archive(DissectedImage *m, LoopD
|
||||
* the mounts are done in a mount namespace there's not going to be a collision here */
|
||||
r = get_common_dissect_directory(&t);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed generate private mount directory: %m");
|
||||
return log_error_errno(r, "Failed to generate private mount directory: %m");
|
||||
|
||||
r = dissected_image_mount_and_warn(
|
||||
m,
|
||||
|
||||
@@ -824,7 +824,7 @@ static int prompt_root_password(int rfd) {
|
||||
break;
|
||||
}
|
||||
|
||||
r = check_password_quality(*a, /* old */ NULL, "root", &error);
|
||||
r = check_password_quality(*a, /* old = */ NULL, "root", &error);
|
||||
if (ERRNO_IS_NEG_NOT_SUPPORTED(r))
|
||||
log_warning("Password quality check is not supported, proceeding anyway.");
|
||||
else if (r < 0)
|
||||
|
||||
@@ -135,7 +135,7 @@ static int add_pkcs11_encrypted_key(
|
||||
|
||||
r = sd_json_variant_append_array(&l, e);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed append PKCS#11 encrypted key: %m");
|
||||
return log_error_errno(r, "Failed to append PKCS#11 encrypted key: %m");
|
||||
|
||||
r = sd_json_variant_set_field(&w, "pkcs11EncryptedKey", l);
|
||||
if (r < 0)
|
||||
|
||||
@@ -31,7 +31,7 @@ static int add_privileged(sd_json_variant **v, const char *hashed) {
|
||||
|
||||
r = sd_json_variant_append_array(&l, e);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed append recovery key: %m");
|
||||
return log_error_errno(r, "Failed to append recovery key: %m");
|
||||
|
||||
r = sd_json_variant_set_field(&w, "recoveryKey", l);
|
||||
if (r < 0)
|
||||
|
||||
+2
-2
@@ -2623,7 +2623,7 @@ static int acquire_group_list(char ***ret) {
|
||||
if (r == -ESRCH)
|
||||
break;
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed acquire next group: %m");
|
||||
return log_debug_errno(r, "Failed to acquire next group: %m");
|
||||
|
||||
if (group_record_disposition(gr) == USER_REGULAR) {
|
||||
_cleanup_(user_record_unrefp) UserRecord *ur = NULL;
|
||||
@@ -5227,7 +5227,7 @@ static int verb_list_signing_keys(int argc, char *argv[], void *userdata) {
|
||||
_cleanup_free_ void *der = NULL;
|
||||
int n = i2d_PUBKEY(key, (unsigned char**) &der);
|
||||
if (n < 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to encode key as DER: %m");
|
||||
return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to encode key as DER.");
|
||||
|
||||
ssize_t m = base64mem(der, MIN(n, 64), &h);
|
||||
if (m < 0)
|
||||
|
||||
@@ -49,7 +49,7 @@ int home_setup_cifs(
|
||||
|
||||
r = parse_cifs_service(h->cifs_service, &chost, &cservice, &cdir);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed parse CIFS service specification: %m");
|
||||
return log_error_errno(r, "Failed to parse CIFS service specification: %m");
|
||||
|
||||
/* Just the host and service part, without the directory */
|
||||
chost_and_service = strjoin("//", chost, "/", cservice);
|
||||
|
||||
@@ -415,7 +415,7 @@ int home_setup_fscrypt(
|
||||
FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_WAIT|FORK_REOPEN_LOG,
|
||||
NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed install encryption key in user's keyring: %m");
|
||||
return log_error_errno(r, "Failed to install encryption key in user's keyring: %m");
|
||||
if (r == 0) {
|
||||
/* Child */
|
||||
|
||||
|
||||
@@ -1227,7 +1227,7 @@ static int open_image_file(
|
||||
if (!S_ISREG(st.st_mode) && !S_ISBLK(st.st_mode))
|
||||
return log_error_errno(
|
||||
S_ISDIR(st.st_mode) ? SYNTHETIC_ERRNO(EISDIR) : SYNTHETIC_ERRNO(EBADFD),
|
||||
"Image file %s is not a regular file or block device: %m", ip);
|
||||
"Image file %s is not a regular file or block device.", ip);
|
||||
|
||||
/* Locking block devices doesn't really make sense, as this might interfere with
|
||||
* udev's workings, and these locks aren't network propagated anyway, hence not what
|
||||
@@ -2731,7 +2731,7 @@ static int prepare_resize_partition(
|
||||
|
||||
r = sd_id128_from_string(disk_uuid_as_string, &disk_uuid);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed parse disk UUID: %m");
|
||||
return log_error_errno(r, "Failed to parse disk UUID: %m");
|
||||
|
||||
r = fdisk_get_partitions(c, &t);
|
||||
if (r < 0)
|
||||
|
||||
@@ -63,7 +63,7 @@ int user_record_check_password_quality(
|
||||
continue;
|
||||
|
||||
/* If there are no old passwords, let's call check_password_quality() without any. */
|
||||
r = check_password_quality(*pp, /* old */ NULL, hr->user_name, &auxerror);
|
||||
r = check_password_quality(*pp, /* old = */ NULL, hr->user_name, &auxerror);
|
||||
if (r <= 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ static const char* fallback_chassis_by_acpi(Context *c) {
|
||||
|
||||
r = device_get_sysattr_unsigned(c->device_acpi, "pm_profile", &t);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed read/parse ACPI PM profile, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to read/parse ACPI PM profile, ignoring: %m");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ static int import_fs(int argc, char *argv[], void *userdata) {
|
||||
(arg_read_only ? INSTALL_READ_ONLY : 0) |
|
||||
(arg_sync ? INSTALL_SYNCFS : 0));
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed install directory as '%s': %m", final_path);
|
||||
return log_error_errno(r, "Failed to install directory as '%s': %m", final_path);
|
||||
|
||||
temp_path = mfree(temp_path);
|
||||
|
||||
|
||||
@@ -63,14 +63,14 @@ static int parse_pull_expression(const char *v) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to extract option string from pull expression '%s': %m", v);
|
||||
if (r == 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No option string in pull expression '%s': %m", v);
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No option string in pull expression '%s'.", v);
|
||||
|
||||
_cleanup_free_ char *local = NULL;
|
||||
r = extract_first_word(&p, &local, ":", EXTRACT_DONT_COALESCE_SEPARATORS);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to extract local name from pull expression '%s': %m", v);
|
||||
if (r == 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No local string in pull expression '%s': %m", v);
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No local string in pull expression '%s'.", v);
|
||||
|
||||
_cleanup_free_ char *remote = strdup(p);
|
||||
if (!remote)
|
||||
|
||||
@@ -274,7 +274,7 @@ static int import_tar(int argc, char *argv[], void *userdata) {
|
||||
return log_error_errno(r, "Cannot extract container name from filename: %m");
|
||||
if (r == O_DIRECTORY)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EISDIR),
|
||||
"Path '%s' refers to directory, but we need a regular file: %m", path);
|
||||
"Path '%s' refers to directory, but we need a regular file.", path);
|
||||
|
||||
local = fn;
|
||||
}
|
||||
@@ -353,7 +353,7 @@ static int import_raw(int argc, char *argv[], void *userdata) {
|
||||
return log_error_errno(r, "Cannot extract container name from filename: %m");
|
||||
if (r == O_DIRECTORY)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EISDIR),
|
||||
"Path '%s' refers to directory, but we need a regular file: %m", path);
|
||||
"Path '%s' refers to directory, but we need a regular file.", path);
|
||||
|
||||
local = fn;
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ static int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_event_set_watchdog(m->event, true);
|
||||
if (r < 0)
|
||||
|
||||
@@ -682,7 +682,7 @@ static int parse_config(void) {
|
||||
{ "Upload", "TrustedCertificateFile", config_parse_path_or_ignore, 0, &arg_trust },
|
||||
{ "Upload", "NetworkTimeoutSec", config_parse_sec, 0, &arg_network_timeout_usec },
|
||||
{ "Upload", "Header", config_parse_header, 0, &arg_headers },
|
||||
{ "Upload", "Compression", config_parse_compression, /* with_level */ true, &arg_compression },
|
||||
{ "Upload", "Compression", config_parse_compression, /* with_level = */ true, &arg_compression },
|
||||
{ "Upload", "ForceCompression", config_parse_bool, 0, &arg_force_compression },
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ int client_context_read_log_filter_patterns(ClientContext *c, const char *cgroup
|
||||
const char *deny_list_xattr = memchr(xattr, (char)0xff, xattr_size);
|
||||
if (!deny_list_xattr)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Missing delimiter in cgroup user.journald_log_filter_patterns attribute: %m");
|
||||
"Missing delimiter in cgroup user.journald_log_filter_patterns attribute.");
|
||||
|
||||
_cleanup_set_free_ Set *allow_list = NULL;
|
||||
r = client_parse_log_filter_nulstr(xattr, deny_list_xattr - xattr, &allow_list);
|
||||
|
||||
@@ -377,7 +377,7 @@ int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_sig
|
||||
manager_reopen_journals(m, &old);
|
||||
|
||||
log_info("Config file reloaded.");
|
||||
(void) sd_notify(/* unset_environment */ false, NOTIFY_READY_MESSAGE);
|
||||
(void) sd_notify(/* unset_environment = */ false, NOTIFY_READY_MESSAGE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1467,7 +1467,7 @@ int manager_relinquish_var(Manager *m) {
|
||||
|
||||
log_debug("Relinquishing %s...", m->system_storage.path);
|
||||
|
||||
(void) manager_system_journal_open(m, /* flush_requested */ false, /* relinquish_requested=*/ true);
|
||||
(void) manager_system_journal_open(m, /* flush_requested = */ false, /* relinquish_requested = */ true);
|
||||
|
||||
m->system_journal = journal_file_offline_close(m->system_journal);
|
||||
ordered_hashmap_clear(m->user_journals);
|
||||
@@ -2290,7 +2290,7 @@ void manager_reopen_journals(Manager *m, const JournalConfig *old) {
|
||||
(void) manager_system_journal_open(m, /* flush_requested = */ false, /* relinquish_requested = */ false);
|
||||
|
||||
/* To make the storage related settings applied, vacuum the storage. */
|
||||
manager_vacuum(m, /* verbose */ false);
|
||||
manager_vacuum(m, /* verbose = */ false);
|
||||
}
|
||||
|
||||
int manager_new(Manager **ret) {
|
||||
|
||||
@@ -61,14 +61,14 @@ int ndisc_redirect_parse(sd_ndisc *nd, sd_ndisc_redirect *rd) {
|
||||
* The ICMP Destination Address field in the redirect message does not contain a multicast address. */
|
||||
if (in6_addr_is_null(&rd->destination_address) || in6_addr_is_multicast(&rd->destination_address))
|
||||
return log_ndisc_errno(nd, SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received Redirect message with an invalid destination address, ignoring datagram: %m");
|
||||
"Received Redirect message with an invalid destination address, ignoring datagram.");
|
||||
|
||||
/* RFC 4861 section 8.1
|
||||
* The ICMP Target Address is either a link-local address (when redirected to a router) or the same
|
||||
* as the ICMP Destination Address (when redirected to the on-link destination). */
|
||||
if (!in6_addr_is_link_local(&rd->target_address) && !in6_addr_equal(&rd->target_address, &rd->destination_address))
|
||||
return log_ndisc_errno(nd, SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received Redirect message with an invalid target address, ignoring datagram: %m");
|
||||
"Received Redirect message with an invalid target address, ignoring datagram.");
|
||||
|
||||
r = ndisc_parse_options(rd->packet, &rd->options);
|
||||
if (r < 0)
|
||||
|
||||
@@ -309,7 +309,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
if (hw_addr.length != sizeof(struct ether_addr))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
|
||||
"Unsupported hardware address length %zu: %m",
|
||||
"Unsupported hardware address length %zu.",
|
||||
hw_addr.length);
|
||||
|
||||
arg_source_mac = hw_addr.ether;
|
||||
|
||||
@@ -85,11 +85,11 @@ int bus_container_connect_socket(sd_bus *b) {
|
||||
if (n > 0) {
|
||||
if (n != sizeof(error_buf))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EIO),
|
||||
"Read error status of unexpected length %zd from (sd-buscntr): %m", n);
|
||||
"Read error status of unexpected length %zd from (sd-buscntr).", n);
|
||||
|
||||
if (error_buf < 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Got unexpected error status from (sd-buscntr): %m");
|
||||
"Got unexpected error status from (sd-buscntr).");
|
||||
|
||||
if (error_buf == EINPROGRESS)
|
||||
return 1;
|
||||
|
||||
@@ -3631,7 +3631,7 @@ static int process_timer(
|
||||
* again. */
|
||||
assert(s->ratelimited);
|
||||
|
||||
r = event_source_leave_ratelimit(s, /* run_callback */ true);
|
||||
r = event_source_leave_ratelimit(s, /* run_callback = */ true);
|
||||
if (r < 0)
|
||||
return r;
|
||||
else if (r == 1)
|
||||
@@ -5116,7 +5116,7 @@ _public_ int sd_event_source_set_ratelimit(sd_event_source *s, uint64_t interval
|
||||
|
||||
/* When ratelimiting is configured we'll always reset the rate limit state first and start fresh,
|
||||
* non-ratelimited. */
|
||||
r = event_source_leave_ratelimit(s, /* run_callback */ false);
|
||||
r = event_source_leave_ratelimit(s, /* run_callback = */ false);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -5179,7 +5179,7 @@ _public_ int sd_event_source_leave_ratelimit(sd_event_source *s) {
|
||||
if (!s->ratelimited)
|
||||
return 0;
|
||||
|
||||
r = event_source_leave_ratelimit(s, /* run_callback */ false);
|
||||
r = event_source_leave_ratelimit(s, /* run_callback = */ false);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ int journal_directory_vacuum(
|
||||
|
||||
r = journal_file_empty(dirfd(d), p);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed check if %s is empty, ignoring: %m", p);
|
||||
log_debug_errno(r, "Failed to check if %s is empty, ignoring: %m", p);
|
||||
continue;
|
||||
}
|
||||
if (r > 0) {
|
||||
|
||||
@@ -134,7 +134,7 @@ static int journal_corrupt_and_append(uint64_t start_offset, uint64_t step) {
|
||||
r = journal_append_message(mj, message);
|
||||
if (r < 0) {
|
||||
/* We care only about crashes or sanitizer errors,
|
||||
* failed write without any crash is a success */
|
||||
* failing to write without any crash is a success */
|
||||
log_info_errno(r, "Failed to write to the journal: %m");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3480,7 +3480,7 @@ _public_ int sd_varlink_server_add_connection_pair(
|
||||
ucred = *override_ucred;
|
||||
else {
|
||||
if (input_fd != output_fd)
|
||||
return varlink_server_log_errno(server, SYNTHETIC_ERRNO(EOPNOTSUPP), "Cannot determine peer identity of connection with separate input/output, refusing: %m");
|
||||
return varlink_server_log_errno(server, SYNTHETIC_ERRNO(EOPNOTSUPP), "Cannot determine peer identity of connection with separate input/output, refusing.");
|
||||
|
||||
r = getpeercred(input_fd, &ucred);
|
||||
if (r < 0)
|
||||
|
||||
@@ -304,7 +304,7 @@ static int list_x11_keymaps(int argc, char **argv, void *userdata) {
|
||||
|
||||
f = fopen("/usr/share/X11/xkb/rules/base.lst", "re");
|
||||
if (!f)
|
||||
return log_error_errno(errno, "Failed to open keyboard mapping list. %m");
|
||||
return log_error_errno(errno, "Failed to open keyboard mapping list: %m");
|
||||
|
||||
if (streq(argv[0], "list-x11-keymap-models"))
|
||||
look_for = MODELS;
|
||||
|
||||
@@ -734,7 +734,7 @@ static int session_dispatch_stop_on_idle(sd_event_source *source, uint64_t t, vo
|
||||
if (idle) {
|
||||
log_info("Session \"%s\" of user \"%s\" is idle, stopping.", s->id, s->user->user_record->user_name);
|
||||
|
||||
return session_stop(s, /* force */ true);
|
||||
return session_stop(s, /* force = */ true);
|
||||
}
|
||||
|
||||
r = sd_event_source_set_time(
|
||||
|
||||
@@ -107,11 +107,11 @@ static int wall_message_timeout_handler(
|
||||
if (next > 0) {
|
||||
r = sd_event_source_set_time(s, n + next);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "sd_event_source_set_time() failed. %m");
|
||||
return log_error_errno(r, "sd_event_source_set_time() failed: %m");
|
||||
|
||||
r = sd_event_source_set_enabled(s, SD_EVENT_ONESHOT);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "sd_event_source_set_enabled() failed. %m");
|
||||
return log_error_errno(r, "sd_event_source_set_enabled() failed: %m");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ static int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
(void) sd_event_set_watchdog(m->event, true);
|
||||
|
||||
|
||||
@@ -1812,7 +1812,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
/* desktop= */ NULL,
|
||||
/* area= */ NULL,
|
||||
&debug,
|
||||
/* default_capability_bounding_set */ NULL,
|
||||
/* default_capability_bounding_set= */ NULL,
|
||||
/* default_capability_ambient_set= */ NULL) < 0)
|
||||
return PAM_SESSION_ERR;
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_event_set_watchdog(m->event, true);
|
||||
if (r < 0)
|
||||
@@ -182,7 +182,7 @@ static int start_one_worker(Manager *m) {
|
||||
}
|
||||
|
||||
r = invoke_callout_binary(SYSTEMD_MOUNTWORK_PATH, STRV_MAKE("systemd-mountwork", "xxxxxxxxxxxxxxxx")); /* With some extra space rename_process() can make use of */
|
||||
log_error_errno(r, "Failed start worker process: %m");
|
||||
log_error_errno(r, "Failed to start worker process: %m");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1187,7 +1187,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r == -ESRCH)
|
||||
return log_error_errno(r, "Parent already died?");
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to send SIGUSR2 signal to parent. %m");
|
||||
return log_error_errno(r, "Failed to send SIGUSR2 signal to parent: %m");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -887,7 +887,7 @@ static int parse_cmdline_ip_interface(Context *context, const char *value) {
|
||||
return log_debug_errno(r < 0 ? r : SYNTHETIC_ERRNO(EINVAL), "Failed to parse interface name in ip=%s: %m", value);
|
||||
|
||||
if (isempty(ifname))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Missing interface name in ip=%s: %m", value);
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Missing interface name in ip=%s.", value);
|
||||
|
||||
r = extract_first_word(&p, &dhcp_type, ":", EXTRACT_DONT_COALESCE_SEPARATORS);
|
||||
if (r <= 0)
|
||||
|
||||
@@ -998,7 +998,7 @@ static int macsec_read_key_file(NetDev *netdev, SecurityAssociation *sa) {
|
||||
|
||||
if (key_len != MACSEC_KEYID_LEN)
|
||||
return log_netdev_error_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Invalid key length (%zu bytes), ignoring: %m", key_len);
|
||||
"Invalid key length (%zu bytes), ignoring.", key_len);
|
||||
|
||||
explicit_bzero_safe(sa->key, sa->key_len);
|
||||
free_and_replace(sa->key, key);
|
||||
|
||||
@@ -1693,7 +1693,7 @@ static int dhcp4_configure(Link *link) {
|
||||
if (link->network->dhcp_fallback_lease_lifetime_usec > 0) {
|
||||
r = sd_dhcp_client_set_fallback_lease_lifetime(link->dhcp_client, link->network->dhcp_fallback_lease_lifetime_usec);
|
||||
if (r < 0)
|
||||
return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed set to lease lifetime: %m");
|
||||
return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set fallback lease lifetime: %m");
|
||||
}
|
||||
|
||||
return dhcp4_set_client_identifier(link);
|
||||
|
||||
@@ -539,7 +539,7 @@ int manager_setup(Manager *m) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_event_add_post(m->event, NULL, manager_post_handler, m);
|
||||
if (r < 0)
|
||||
|
||||
@@ -272,8 +272,7 @@ int link_update_monitor(Link *l) {
|
||||
else {
|
||||
r = parse_operational_state_range(required_operstate, &l->required_operstate);
|
||||
if (r < 0)
|
||||
ret = log_link_debug_errno(l, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to parse required operational state, ignoring: %m");
|
||||
ret = log_link_debug_errno(l, r, "Failed to parse required operational state, ignoring: %m");
|
||||
}
|
||||
|
||||
r = network_link_get_operational_state(l->ifindex, &l->operational_state);
|
||||
|
||||
@@ -685,7 +685,7 @@ int mount_all(const char *dest,
|
||||
|
||||
log_debug_errno(r, "Failed to create directory %s: %m", where);
|
||||
|
||||
/* If we failed mkdir() or chown() due to the root directory being read only,
|
||||
/* If mkdir() or chown() failed due to the root directory being read only,
|
||||
* attempt to mount this fs anyway and let mount_verbose log any errors */
|
||||
if (r != -EROFS)
|
||||
continue;
|
||||
|
||||
@@ -1011,7 +1011,7 @@ static int network_iface_pair_parse(const char* iftype, char ***l, const char *p
|
||||
return log_error_errno(r, "Failed to extract first word in %s parameter: %m", iftype);
|
||||
if (r == 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"Short read while reading %s parameter: %m", iftype);
|
||||
"Short read while reading %s parameter.", iftype);
|
||||
if (!ifname_valid(a))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"%s, interface name not valid: %s", iftype, a);
|
||||
|
||||
+2
-2
@@ -1366,7 +1366,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
} else {
|
||||
r = read_full_file(optarg, (char**) &p, &l);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed parse root hash signature file '%s': %m", optarg);
|
||||
return log_error_errno(r, "Failed to parse root hash signature file '%s': %m", optarg);
|
||||
}
|
||||
|
||||
free_and_replace(arg_verity_settings.root_hash_sig, p);
|
||||
@@ -5583,7 +5583,7 @@ static int run_container(
|
||||
|
||||
r = sd_event_add_memory_pressure(event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
/* Exit when the child exits */
|
||||
(void) sd_event_add_signal(event, NULL, SIGCHLD, on_sigchld, pid);
|
||||
|
||||
@@ -114,7 +114,7 @@ int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_event_set_watchdog(m->event, true);
|
||||
if (r < 0)
|
||||
@@ -230,7 +230,7 @@ static int start_one_worker(Manager *m) {
|
||||
}
|
||||
|
||||
r = invoke_callout_binary(SYSTEMD_NSRESOURCEWORK_PATH, STRV_MAKE("systemd-nsresourcework", "xxxxxxxxxxxxxxxx")); /* With some extra space rename_process() can make use of */
|
||||
log_error_errno(r, "Failed start worker process: %m");
|
||||
log_error_errno(r, "Failed to start worker process: %m");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -2069,7 +2069,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r == -ESRCH)
|
||||
return log_error_errno(r, "Parent already died?");
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to send SIGUSR2 signal to parent. %m");
|
||||
return log_error_errno(r, "Failed to send SIGUSR2 signal to parent: %m");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ static int make_inner_hash_map(void) {
|
||||
MOUNTS_MAX,
|
||||
NULL);
|
||||
if (fd < 0)
|
||||
return log_debug_errno(errno, "Failed allocate inner BPF map: %m");
|
||||
return log_debug_errno(errno, "Failed to allocate inner BPF map: %m");
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
+2
-2
@@ -527,13 +527,13 @@ int oomd_system_context_acquire(const char *proc_meminfo_path, OomdSystemContext
|
||||
|
||||
if (mem_available > ctx.mem_total)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"MemAvailable (%" PRIu64 ") cannot be greater than MemTotal (%" PRIu64 ") %m",
|
||||
"MemAvailable (%" PRIu64 ") cannot be greater than MemTotal (%" PRIu64 ")",
|
||||
mem_available,
|
||||
ctx.mem_total);
|
||||
|
||||
if (swap_free > ctx.swap_total)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"SwapFree (%" PRIu64 ") cannot be greater than SwapTotal (%" PRIu64 ") %m",
|
||||
"SwapFree (%" PRIu64 ") cannot be greater than SwapTotal (%" PRIu64 ")",
|
||||
swap_free,
|
||||
ctx.swap_total);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ static int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
(void) sd_event_set_watchdog(m->event, true);
|
||||
|
||||
|
||||
+1
-1
@@ -7601,7 +7601,7 @@ static int resolve_copy_blocks_auto(
|
||||
}
|
||||
}
|
||||
} else if (errno != ENOENT)
|
||||
return log_error_errno(errno, "Failed open %s: %m", p);
|
||||
return log_error_errno(errno, "Failed to open %s: %m", p);
|
||||
else {
|
||||
r = resolve_copy_blocks_auto_candidate(devno, type, restrict_devno, &found_uuid);
|
||||
if (r < 0)
|
||||
|
||||
@@ -229,7 +229,7 @@ static int manager_process_route(sd_netlink *rtnl, sd_netlink_message *mm, void
|
||||
|
||||
r = sd_netlink_message_get_type(mm, &type);
|
||||
if (r < 0) {
|
||||
log_warning_errno(r, "Failed not get message type, ignoring: %m");
|
||||
log_warning_errno(r, "Failed to get rtnl message type, ignoring: %m");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -785,23 +785,23 @@ int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_signal(m->event, /* ret= */ NULL, SIGHUP | SD_EVENT_SIGNAL_PROCMASK, manager_dispatch_reload_signal, m);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed install SIGHUP handler: %m");
|
||||
return log_debug_errno(r, "Failed to install SIGHUP handler: %m");
|
||||
|
||||
r = sd_event_add_signal(m->event, /* ret= */ NULL, SIGUSR1 | SD_EVENT_SIGNAL_PROCMASK, manager_sigusr1, m);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed install SIGUSR1 handler: %m");
|
||||
return log_debug_errno(r, "Failed to install SIGUSR1 handler: %m");
|
||||
|
||||
r = sd_event_add_signal(m->event, /* ret= */ NULL, SIGUSR2 | SD_EVENT_SIGNAL_PROCMASK, manager_sigusr2, m);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed install SIGUSR2 handler: %m");
|
||||
return log_debug_errno(r, "Failed to install SIGUSR2 handler: %m");
|
||||
|
||||
r = sd_event_add_signal(m->event, /* ret= */ NULL, (SIGRTMIN+1) | SD_EVENT_SIGNAL_PROCMASK, manager_sigrtmin1, m);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed install SIGRTMIN+1 handler: %m");
|
||||
return log_debug_errno(r, "Failed to install SIGRTMIN+1 handler: %m");
|
||||
|
||||
r = sd_event_add_signal(m->event, /* ret= */ NULL, (SIGRTMIN+18) | SD_EVENT_SIGNAL_PROCMASK, sigrtmin18_handler, &m->sigrtmin18_info);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed install SIGRTMIN+18 handler: %m");
|
||||
return log_debug_errno(r, "Failed to install SIGRTMIN+18 handler: %m");
|
||||
|
||||
manager_cleanup_saved_user(m);
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ static int mdns_goodbye_callback(sd_event_source *s, uint64_t usec, void *userda
|
||||
|
||||
r = mdns_notify_browsers_goodbye(scope);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "mDNS: Failed to notify service subscribers of goodbyes, ignoring: %m");
|
||||
log_warning_errno(r, "mDNS: Failed to notify service subscribers of goodbyes, ignoring: %m");
|
||||
|
||||
if (dns_cache_expiry_in_one_second(&scope->cache, usec)) {
|
||||
r = sd_event_add_time_relative(
|
||||
|
||||
@@ -178,7 +178,7 @@ int read_credential_with_decryption(const char *name, void **ret, size_t *ret_si
|
||||
if (r >= 0)
|
||||
return 1; /* found */
|
||||
if (!IN_SET(r, -ENXIO, -ENOENT))
|
||||
return log_error_errno(r, "Failed read unencrypted credential '%s': %m", name);
|
||||
return log_error_errno(r, "Failed to read unencrypted credential '%s': %m", name);
|
||||
|
||||
r = get_encrypted_credentials_dir(&d);
|
||||
if (r == -ENXIO)
|
||||
@@ -920,7 +920,7 @@ int encrypt_credential_and_warn(
|
||||
r = tpm2_load_pcr_public_key(tpm2_pubkey_path, &pubkey.iov_base, &pubkey.iov_len);
|
||||
if (r < 0) {
|
||||
if (tpm2_pubkey_path || r != -ENOENT || !sd_id128_in_set(with_key, _CRED_AUTO, _CRED_AUTO_INITRD, _CRED_AUTO_SCOPED))
|
||||
return log_error_errno(r, "Failed read TPM PCR public key: %m");
|
||||
return log_error_errno(r, "Failed to read TPM PCR public key: %m");
|
||||
|
||||
log_debug_errno(r, "Failed to read TPM2 PCR public key, proceeding without: %m");
|
||||
}
|
||||
|
||||
@@ -3196,7 +3196,7 @@ int image_filter_parse(const char *s, ImageFilter **ret) {
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to extract designator: %m");
|
||||
if (r != 2 || !isempty(x))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Unable to split: %m");
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Unable to split: %s", word);
|
||||
|
||||
PartitionDesignator d = partition_designator_from_string(designator);
|
||||
if (d < 0)
|
||||
@@ -4584,7 +4584,7 @@ int mountfsd_mount_image(
|
||||
if (image_policy) {
|
||||
r = image_policy_to_string(image_policy, /* simplify= */ false, &ps);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed format image policy to string: %m");
|
||||
return log_error_errno(r, "Failed to format image policy to string: %m");
|
||||
}
|
||||
|
||||
sd_json_variant *reply = NULL;
|
||||
|
||||
@@ -103,7 +103,7 @@ static int verify_esp_blkid(
|
||||
if (r != 0)
|
||||
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
|
||||
SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
|
||||
"No filesystem found on \"%s\": %m", node);
|
||||
"No filesystem found on \"%s\".", node);
|
||||
if (!streq(v, "vfat"))
|
||||
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
|
||||
SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
|
||||
@@ -631,7 +631,7 @@ static int verify_xbootldr_blkid(
|
||||
if (r != 0)
|
||||
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
|
||||
searching ? SYNTHETIC_ERRNO(EADDRNOTAVAIL) : SYNTHETIC_ERRNO(EIO),
|
||||
"%s: Failed to probe PART_ENTRY_SCHEME: %m", node);
|
||||
"%s: Failed to probe PART_ENTRY_SCHEME.", node);
|
||||
if (streq(type, "gpt")) {
|
||||
|
||||
errno = 0;
|
||||
|
||||
@@ -127,7 +127,7 @@ int check_password_quality(
|
||||
|
||||
check_reason = sym_passwdqc_check(¶ms->qc, password, old, &pw);
|
||||
} else
|
||||
check_reason = sym_passwdqc_check(¶ms->qc, password, old, /* pw */ NULL);
|
||||
check_reason = sym_passwdqc_check(¶ms->qc, password, old, /* pw = */ NULL);
|
||||
|
||||
if (check_reason) {
|
||||
if (ret_error) {
|
||||
|
||||
@@ -1538,7 +1538,7 @@ int seccomp_protect_syslog(void) {
|
||||
0);
|
||||
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed to add syslog() rule for architecture %s, skipping %m", seccomp_arch_to_string(arch));
|
||||
log_debug_errno(r, "Failed to add syslog() rule for architecture %s, skipping: %m", seccomp_arch_to_string(arch));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1546,7 +1546,7 @@ int seccomp_protect_syslog(void) {
|
||||
if (ERRNO_IS_NEG_SECCOMP_FATAL(r))
|
||||
return r;
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to install syslog protection rules for architecture %s, skipping %m",
|
||||
log_debug_errno(r, "Failed to install syslog protection rules for architecture %s, skipping: %m",
|
||||
seccomp_arch_to_string(arch));
|
||||
}
|
||||
|
||||
|
||||
@@ -1141,7 +1141,7 @@ static int tpm2_credit_random(Tpm2Context *c) {
|
||||
|
||||
r = random_write_entropy(-1, buffer->buffer, buffer->size, /* credit= */ false);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed wo write entropy to kernel: %m");
|
||||
return log_debug_errno(r, "Failed to write entropy to kernel: %m");
|
||||
|
||||
done += buffer->size;
|
||||
rps = LESS_BY(rps, buffer->size);
|
||||
|
||||
@@ -57,11 +57,11 @@ int varlink_server_deserialize_one(sd_varlink_server *s, const char *value, FDSe
|
||||
|
||||
if (v[n] != ' ')
|
||||
return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to deserialize sd_varlink_server_socket: %s: %m", value);
|
||||
"Failed to deserialize sd_varlink_server_socket: %s", value);
|
||||
v = startswith(v + n + 1, "varlink-server-socket-fd=");
|
||||
if (!v)
|
||||
return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to deserialize VarlinkServerSocket fd %s: %m", value);
|
||||
"Failed to deserialize VarlinkServerSocket fd: %s", value);
|
||||
|
||||
n = strcspn(v, " ");
|
||||
buf = strndupa_safe(v, n);
|
||||
@@ -71,7 +71,7 @@ int varlink_server_deserialize_one(sd_varlink_server *s, const char *value, FDSe
|
||||
return varlink_server_log_errno(s, fd, "Unable to parse VarlinkServerSocket varlink-server-socket-fd=%s: %m", buf);
|
||||
if (!fdset_contains(fds, fd))
|
||||
return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EBADF),
|
||||
"VarlinkServerSocket varlink-server-socket-fd= has unknown fd %d: %m", fd);
|
||||
"VarlinkServerSocket varlink-server-socket-fd= has unknown fd: %d", fd);
|
||||
|
||||
ss = new(VarlinkServerSocket, 1);
|
||||
if (!ss)
|
||||
|
||||
+3
-3
@@ -254,7 +254,7 @@ static int need_reload(
|
||||
const char *extension_reload_manager = NULL;
|
||||
int b;
|
||||
|
||||
r = load_extension_release_pairs(arg_root, image_class, *extension, /* relax_extension_release_check */ true, &extension_release);
|
||||
r = load_extension_release_pairs(arg_root, image_class, *extension, /* relax_extension_release_check = */ true, &extension_release);
|
||||
if (r < 0) {
|
||||
log_debug_errno(r, "Failed to parse extension-release metadata of %s, ignoring: %m", *extension);
|
||||
continue;
|
||||
@@ -1547,7 +1547,7 @@ static int store_info_in_meta(
|
||||
|
||||
/* Make sure the top-level dir has an mtime marking the point we established the merge */
|
||||
if (utimensat(AT_FDCWD, meta_path, NULL, AT_SYMLINK_NOFOLLOW) < 0)
|
||||
return log_error_errno(r, "Failed fix mtime of '%s': %m", meta_path);
|
||||
return log_error_errno(r, "Failed to fix mtime of '%s': %m", meta_path);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1731,7 +1731,7 @@ static int merge_subprocess(
|
||||
return log_error_errno(r, "Failed to acquire 'os-release' data of OS tree '%s': %m", empty_to_root(arg_root));
|
||||
if (isempty(host_os_release_id))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"'ID' field not found or empty in 'os-release' data of OS tree '%s': %m",
|
||||
"'ID' field not found or empty in 'os-release' data of OS tree '%s'.",
|
||||
empty_to_root(arg_root));
|
||||
|
||||
/* Let's now mount all images */
|
||||
|
||||
@@ -327,7 +327,7 @@ static int download_manifest(
|
||||
|
||||
manifest = fdopen(pfd[0], "r");
|
||||
if (!manifest)
|
||||
return log_error_errno(errno, "Failed allocate FILE object for manifest file: %m");
|
||||
return log_error_errno(errno, "Failed to allocate FILE object for manifest file: %m");
|
||||
|
||||
TAKE_FD(pfd[0]);
|
||||
|
||||
|
||||
@@ -409,7 +409,7 @@ static int config_parse_resource_ptype(
|
||||
r = gpt_partition_type_from_string(rvalue, &rr->partition_type);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed parse partition type, ignoring: %s", rvalue);
|
||||
"Failed to parse partition type, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ static int config_parse_partition_uuid(
|
||||
r = sd_id128_from_string(rvalue, &t->partition_uuid);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed parse partition UUID, ignoring: %s", rvalue);
|
||||
"Failed to parse partition UUID, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ static int config_parse_partition_flags(
|
||||
r = safe_atou64(rvalue, &t->partition_flags);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed parse partition flags, ignoring: %s", rvalue);
|
||||
"Failed to parse partition flags, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1738,7 +1738,7 @@ static int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_bus_default_system(&m->bus);
|
||||
if (r < 0)
|
||||
|
||||
@@ -249,12 +249,12 @@ static int test_bpf_cgroup_programs(Manager *m, const char *unit_name, const Tes
|
||||
ASSERT_OK(unit_patch_contexts(u));
|
||||
r = unit_start(u, NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Unit start failed %m");
|
||||
return log_error_errno(r, "Unit start failed: %m");
|
||||
|
||||
while (!IN_SET(SERVICE(u)->state, SERVICE_DEAD, SERVICE_FAILED)) {
|
||||
r = sd_event_run(m->event, UINT64_MAX);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Event run failed %m");
|
||||
return log_error_errno(r, "Event run failed: %m");
|
||||
}
|
||||
|
||||
cld_code = SERVICE(u)->exec_command[SERVICE_EXEC_START]->exec_status.code;
|
||||
|
||||
@@ -41,12 +41,12 @@ static int test_restrict_filesystems(Manager *m, const char *unit_name, const ch
|
||||
ASSERT_OK(unit_patch_contexts(u));
|
||||
r = unit_start(u, NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Unit start failed %m");
|
||||
return log_error_errno(r, "Unit start failed: %m");
|
||||
|
||||
while (!IN_SET(SERVICE(u)->state, SERVICE_DEAD, SERVICE_FAILED)) {
|
||||
r = sd_event_run(m->event, UINT64_MAX);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Event run failed %m");
|
||||
return log_error_errno(r, "Event run failed: %m");
|
||||
}
|
||||
|
||||
cld_code = SERVICE(u)->exec_command[SERVICE_EXEC_START]->exec_status.code;
|
||||
|
||||
@@ -192,11 +192,11 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
r = btrfs_subvol_remove("/xxxquotatest", BTRFS_REMOVE_QUOTA|BTRFS_REMOVE_RECURSIVE);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed remove subvolume: %m");
|
||||
log_error_errno(r, "Failed to remove subvolume: %m");
|
||||
|
||||
r = btrfs_subvol_remove("/xxxquotatest2", BTRFS_REMOVE_QUOTA|BTRFS_REMOVE_RECURSIVE);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed remove subvolume: %m");
|
||||
log_error_errno(r, "Failed to remove subvolume: %m");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ static void* thread_func(void *ptr) {
|
||||
DISSECT_IMAGE_READ_ONLY|DISSECT_IMAGE_ADD_PARTITION_DEVICES|DISSECT_IMAGE_PIN_PARTITION_DEVICES,
|
||||
&dissected);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed dissect loopback device %s: %m", loop->node);
|
||||
log_error_errno(r, "Failed to dissect loopback device %s: %m", loop->node);
|
||||
assert_se(r >= 0);
|
||||
|
||||
log_info("Dissected loop device %s", loop->node);
|
||||
|
||||
@@ -80,12 +80,12 @@ static int test_socket_bind(
|
||||
ASSERT_OK(unit_patch_contexts(u));
|
||||
r = unit_start(u, NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Unit start failed %m");
|
||||
return log_error_errno(r, "Unit start failed: %m");
|
||||
|
||||
while (!IN_SET(SERVICE(u)->state, SERVICE_DEAD, SERVICE_FAILED)) {
|
||||
r = sd_event_run(m->event, UINT64_MAX);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Event run failed %m");
|
||||
return log_error_errno(r, "Event run failed: %m");
|
||||
}
|
||||
|
||||
cld_code = SERVICE(u)->exec_command[SERVICE_EXEC_START]->exec_status.code;
|
||||
|
||||
@@ -1143,7 +1143,7 @@ int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_event_set_watchdog(m->event, true);
|
||||
if (r < 0)
|
||||
|
||||
@@ -661,7 +661,7 @@ static int link_generate_new_hw_addr(Link *link, struct hw_addr_data *ret) {
|
||||
memcpy(p, &result, len);
|
||||
if (!hw_addr_is_valid(link, &hw_addr))
|
||||
return log_link_warning_errno(link, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Could not generate valid persistent MAC address: %m");
|
||||
"Could not generate valid persistent MAC address.");
|
||||
}
|
||||
|
||||
finalize:
|
||||
|
||||
@@ -539,7 +539,7 @@ static int get_device_firmware_node_sun(sd_device *dev, uint32_t *ret) {
|
||||
if (r < 0)
|
||||
return log_device_debug_errno(dev, r, "Failed to parse firmware_node/sun '%s', ignoring: %m", attr);
|
||||
if (sun == 0)
|
||||
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL), "firmware_node/sun == 0, ignoring: %m");
|
||||
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL), "firmware_node/sun == 0, ignoring.");
|
||||
|
||||
*ret = sun;
|
||||
return 0;
|
||||
|
||||
@@ -861,7 +861,7 @@ static int event_enter_locked(Event *event, const char *whole_disk) {
|
||||
if (isempty(whole_disk))
|
||||
return log_device_warning_errno(
|
||||
dev, SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Unexpected notify message received, skipping event (SEQNUM=%"PRIu64", ACTION=%s): %m",
|
||||
"Unexpected notify message received, skipping event (SEQNUM=%"PRIu64", ACTION=%s).",
|
||||
event->seqnum, strna(device_action_to_string(event->action)));
|
||||
|
||||
_cleanup_free_ char *whole_disk_copy = strdup(whole_disk);
|
||||
|
||||
@@ -954,7 +954,7 @@ static int parse_token(
|
||||
if (is_case_insensitive)
|
||||
return log_line_invalid_prefix(rule_line, key);
|
||||
|
||||
r = rule_line_add_token(rule_line, TK_M_PROGRAM, op, value, NULL, /* is_case_insensitive */ false, token_str);
|
||||
r = rule_line_add_token(rule_line, TK_M_PROGRAM, op, value, NULL, /* is_case_insensitive = */ false, token_str);
|
||||
} else if (streq(key, "IMPORT")) {
|
||||
if (isempty(attr))
|
||||
return log_line_invalid_attr(rule_line, key);
|
||||
|
||||
@@ -490,7 +490,7 @@ static int display_user(int argc, char *argv[], void *userdata) {
|
||||
if (r == -EHOSTDOWN)
|
||||
return log_error_errno(r, "Selected user database service is not available for this request.");
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed acquire next user: %m");
|
||||
return log_error_errno(r, "Failed to acquire next user: %m");
|
||||
|
||||
if (draw_separator && arg_output == OUTPUT_FRIENDLY)
|
||||
putchar('\n');
|
||||
@@ -830,7 +830,7 @@ static int display_group(int argc, char *argv[], void *userdata) {
|
||||
if (r == -EHOSTDOWN)
|
||||
return log_error_errno(r, "Selected group database service is not available for this request.");
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed acquire next group: %m");
|
||||
return log_error_errno(r, "Failed to acquire next group: %m");
|
||||
|
||||
if (draw_separator && arg_output == OUTPUT_FRIENDLY)
|
||||
putchar('\n');
|
||||
@@ -977,7 +977,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
|
||||
if (r == -EHOSTDOWN)
|
||||
return log_error_errno(r, "Selected membership database service is not available for this request.");
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed acquire next membership: %m");
|
||||
return log_error_errno(r, "Failed to acquire next membership: %m");
|
||||
|
||||
r = show_membership(user, group, table);
|
||||
if (r < 0)
|
||||
@@ -1004,7 +1004,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) {
|
||||
if (r == -EHOSTDOWN)
|
||||
return log_error_errno(r, "Selected membership database service is not available for this request.");
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed acquire next membership: %m");
|
||||
return log_error_errno(r, "Failed to acquire next membership: %m");
|
||||
|
||||
r = show_membership(user, group, table);
|
||||
if (r < 0)
|
||||
|
||||
@@ -103,7 +103,7 @@ int manager_new(Manager **ret) {
|
||||
|
||||
r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
r = sd_event_set_watchdog(m->event, true);
|
||||
if (r < 0)
|
||||
@@ -198,7 +198,7 @@ static int start_one_worker(Manager *m) {
|
||||
}
|
||||
|
||||
r = invoke_callout_binary(SYSTEMD_USERWORK_PATH, STRV_MAKE(SYSTEMD_USERWORK_PATH, "xxxxxxxxxxxxxxxx")); /* With some extra space rename_process() can make use of */
|
||||
log_error_errno(r, "Failed start worker process: %m");
|
||||
log_error_errno(r, "Failed to start worker process: %m");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1616,7 +1616,7 @@ static int grow_image(const char *path, uint64_t size) {
|
||||
}
|
||||
|
||||
if (ftruncate(fd, size) < 0)
|
||||
return log_error_errno(errno, "Failed grow image file '%s' from %s to %s: %m", path,
|
||||
return log_error_errno(errno, "Failed to grow image file '%s' from %s to %s: %m", path,
|
||||
FORMAT_BYTES(st.st_size), FORMAT_BYTES(size));
|
||||
|
||||
r = fsync_full(fd);
|
||||
@@ -2204,7 +2204,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
|
||||
else if (S_ISBLK(st.st_mode))
|
||||
driver = "host_device";
|
||||
else
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Expected regular file or block device, not '%s': %m", *drive);
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Expected regular file or block device, not '%s'.", *drive);
|
||||
|
||||
r = strv_extendf(&cmdline, "driver=raw,cache.direct=off,cache.no-flush=on,file.driver=%s,file.filename=%s,node-name=vmspawn_extra_%zu", driver, escaped_drive, i);
|
||||
if (r < 0)
|
||||
@@ -2691,7 +2691,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
|
||||
|
||||
r = sd_event_add_memory_pressure(event, NULL, NULL, NULL);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to allocate memory pressure event source, ignoring: %m");
|
||||
|
||||
/* Exit when the child exits */
|
||||
r = event_add_child_pidref(event, /* ret= */ NULL, &child_pidref, WEXITED, on_child_exit, /* userdata= */ NULL);
|
||||
|
||||
Reference in New Issue
Block a user