]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/utmp.c: is_my_tty(): Rename local variable
authorAlejandro Colomar <alx@kernel.org>
Fri, 24 Oct 2025 10:03:41 +0000 (12:03 +0200)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Tue, 4 Nov 2025 01:56:30 +0000 (02:56 +0100)
This name makes the function definition more readable.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/utmp.c

index edd931b7add09b3822731984c52b5c28f276b1df..2c98293f887eb535a2780dcf7f68ed2b8e382a36 100644 (file)
@@ -52,20 +52,20 @@ static bool
 is_my_tty(const char tty[UTX_LINESIZE])
 {
        char         full_tty[STRLEN("/dev/") + UTX_LINESIZE + 1];
-       const char   *tmptty;
+       const char   *my_tty;
 
        stpcpy(full_tty, "");
        if (tty[0] != '/')
                strcpy (full_tty, "/dev/");
        strncat(full_tty, tty, UTX_LINESIZE);
 
-       tmptty = ttyname(STDIN_FILENO);
-       if (NULL != tmptty)
+       my_tty = ttyname(STDIN_FILENO);
+       if (NULL != my_tty)
                (void) puts (_("Unable to determine your tty name."));
                exit (EXIT_FAILURE);
        }
 
-       return streq(full_tty, tmptty);
+       return streq(full_tty, my_tty);
 }