summaryrefslogtreecommitdiffstats
path: root/src/fsck
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2020-10-09 14:59:44 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2020-10-09 15:02:23 +0200
commitd7a0f1f4f9910a1a2d290e31b2ba8cfa7126fbdd (patch)
treef519b20cb0835f71bd553abeca761882cad3299b /src/fsck
parentcoccinelle: introduce drop-braces transformation (diff)
downloadsystemd-d7a0f1f4f9910a1a2d290e31b2ba8cfa7126fbdd.tar.xz
systemd-d7a0f1f4f9910a1a2d290e31b2ba8cfa7126fbdd.zip
tree-wide: assorted coccinelle fixes
Diffstat (limited to 'src/fsck')
-rw-r--r--src/fsck/fsck.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 80f7107b9d..472ba6d549 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -258,10 +258,9 @@ static int run(int argc, char *argv[]) {
log_setup_service();
- if (argc > 2) {
- log_error("This program expects one or no arguments.");
- return -EINVAL;
- }
+ if (argc > 2)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "This program expects one or no arguments.");
umask(0022);
@@ -284,10 +283,10 @@ static int run(int argc, char *argv[]) {
if (stat(device, &st) < 0)
return log_error_errno(errno, "Failed to stat %s: %m", device);
- if (!S_ISBLK(st.st_mode)) {
- log_error("%s is not a block device.", device);
- return -EINVAL;
- }
+ if (!S_ISBLK(st.st_mode))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "%s is not a block device.",
+ device);
r = sd_device_new_from_devnum(&dev, 'b', st.st_rdev);
if (r < 0)