]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-daemon: drop some redundant 'else'
authorLennart Poettering <lennart@poettering.net>
Mon, 4 Nov 2024 10:01:07 +0000 (11:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 4 Nov 2024 10:01:07 +0000 (11:01 +0100)
src/libsystemd/sd-daemon/sd-daemon.c

index ae890b6d2050569dbc27bf9397470d6da4ace96d..26e4257a1ffecc153d9fd5740520294af184fc32 100644 (file)
@@ -180,10 +180,10 @@ _public_ int sd_is_special(int fd, const char *path) {
 
                 if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode))
                         return stat_inode_same(&st_path, &st_fd);
-                else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode))
+                if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode))
                         return st_path.st_rdev == st_fd.st_rdev;
-                else
-                        return 0;
+
+                return 0;
         }
 
         return 1;