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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user