tree-wise: several cleanups for logging

- drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate
  error code,
- drop unnecessary '%m' in error message when the error code is
  specified with SYNTHETIC_ERRNO(),
- add missing full stop at the end of log message,
- use RET_GATHER(),
- add missing ", ignoring.",
- upeercase the first letter, etc., etc...
This commit is contained in:
Yu Watanabe
2024-05-01 04:41:06 +09:00
parent ba2caa8a38
commit 4e494e6aac
43 changed files with 167 additions and 185 deletions
+2 -2
View File
@@ -21,10 +21,10 @@ static int uri_set_private_class(const char *uri, char **ret_uri) {
CK_ATTRIBUTE attribute = { CKA_CLASS, &class, sizeof(class) };
if (sym_p11_kit_uri_set_attribute(p11kit_uri, &attribute) != P11_KIT_URI_OK)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to set class for URI '%s': %m", uri);
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to set class for URI '%s'.", uri);
if (sym_p11_kit_uri_format(p11kit_uri, P11_KIT_URI_FOR_ANY, &private_uri) != P11_KIT_URI_OK)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to format PKCS#11 URI: %m");
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to format PKCS#11 URI.");
}
*ret_uri = TAKE_PTR(private_uri);
+1 -1
View File
@@ -143,7 +143,7 @@ static int determine_default_node(void) {
return log_error_errno(r, "Unable to query DM_UUID udev property of backing block device for /var/: %m");
if (!startswith(dm_uuid, "CRYPT-LUKS2-"))
return log_error_errno(SYNTHETIC_ERRNO(ENXIO), "Block device backing /var/ is not a LUKS2 device: %m");
return log_error_errno(SYNTHETIC_ERRNO(ENXIO), "Block device backing /var/ is not a LUKS2 device.");
_cleanup_(sd_device_unrefp) sd_device *origin = NULL;
r = block_device_get_originating(dev, &origin);