From: Karel Zak Date: Tue, 3 Mar 2026 11:34:43 +0000 (+0100) Subject: agetty: simplify USE_SYSTEMD ifdef in output_special_char X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a20b01cc35da902521bb4dc6a84dfac3dd90e248;p=thirdparty%2Futil-linux.git agetty: simplify USE_SYSTEMD ifdef in output_special_char 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 --- diff --git a/term-utils/agetty.c b/term-utils/agetty.c index f0dc66e78..0ce8fca61 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -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