]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: improve coding style
authorKarel Zak <kzak@redhat.com>
Tue, 2 Nov 2021 11:19:28 +0000 (12:19 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Nov 2021 11:19:28 +0000 (12:19 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c

index 975a37943c63a34f9c6a92d27b11d70cee4ebeda..7229692ddd2586ffefbbf904218056dbeb09eeef 100644 (file)
@@ -583,9 +583,9 @@ static void init_tty(struct login_context *cxt)
        tcsetattr(0, TCSAFLUSH, &tt);
 
        /* Restore tty size */
-       if (ws.ws_row > 0 || ws.ws_col > 0)
-               if (ioctl(STDIN_FILENO, TIOCSWINSZ, &ws) < 0)
-                       syslog(LOG_WARNING, _("TIOCSWINSZ ioctl failed: %m"));
+       if ((ws.ws_row > 0 || ws.ws_col > 0)
+           && ioctl(STDIN_FILENO, TIOCSWINSZ, &ws) < 0)
+               syslog(LOG_WARNING, _("TIOCSWINSZ ioctl failed: %m"));
 }
 
 /*