]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: simplify USE_SYSTEMD ifdef in output_special_char
authorKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2026 11:34:43 +0000 (12:34 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2026 11:35:24 +0000 (12:35 +0100)
Remove unnecessary duplicate #ifdef USE_SYSTEMD around the else
branch for utmpx-based user counting. Use the same pattern as
USE_NETLINK where the else and opening brace are split across the
endif boundary.

Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c

index f0dc66e788c135708b48256445587ee2b0b34f61..0ce8fca61a7c06a2882bb330b90999a014a8da11 100644 (file)
@@ -2948,8 +2948,9 @@ static void output_special_char(struct issue *ie,
                        users = sd_get_sessions(NULL);
                        if (users < 0)
                                users = 0;
-               } else {
+               } else
 #endif
+               {
                        users = 0;
                        struct utmpx *ut;
                        setutxent();
@@ -2957,9 +2958,7 @@ static void output_special_char(struct issue *ie,
                                if (ut->ut_type == USER_PROCESS)
                                        users++;
                        endutxent();
-#ifdef USE_SYSTEMD
                }
-#endif
                if (c == 'U')
                        fprintf(ie->output, P_("%d user", "%d users", users), users);
                else