return log_oom();
/* Nothing to work on. */
- if (!is_device_path(node)) {
- log_error("Cannot format something that is not a device node: %s", node);
- return -EINVAL;
- }
+ if (!is_device_path(node))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Cannot format something that is not a device node: %s",
+ node);
r = unit_name_from_path_instance("systemd-mkswap", node, ".service", &unit);
if (r < 0)
return log_oom();
/* Nothing to work on. */
- if (!is_device_path(node)) {
- log_error("Cannot format something that is not a device node: %s", node);
- return -EINVAL;
- }
+ if (!is_device_path(node))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Cannot format something that is not a device node: %s",
+ node);
- if (!type || streq(type, "auto")) {
- log_error("Cannot format partition %s, filesystem type is not specified", node);
- return -EINVAL;
- }
+ if (!type || streq(type, "auto"))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Cannot format partition %s, filesystem type is not specified",
+ node);
r = unit_name_from_path_instance("systemd-mkfs", node, ".service", &unit);
if (r < 0)