summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorKarel Zak2019-05-20 12:35:38 +0200
committerKarel Zak2019-05-20 12:35:38 +0200
commit002931c485dd66c23b63750a7d9d09637e9bc1ef (patch)
treef4209fc28f52b9aa6159af0afb43b43f07b4326f /login-utils
parentMerge branch 'lscpu_midr_updates' of https://github.com/jlinton/util-linux (diff)
parentlib/colors: remove redundant if statement (diff)
downloadkernel-qcow2-util-linux-002931c485dd66c23b63750a7d9d09637e9bc1ef.tar.gz
kernel-qcow2-util-linux-002931c485dd66c23b63750a7d9d09637e9bc1ef.tar.xz
kernel-qcow2-util-linux-002931c485dd66c23b63750a7d9d09637e9bc1ef.zip
Merge branch '2019wk19' of https://github.com/kerolasa/util-linux
* '2019wk19' of https://github.com/kerolasa/util-linux: lib/colors: remove redundant if statement wipefs: fix variable / function shadowing [cppcheck] sulogin: fix variable / function shadowing [cppcheck] lscpu: remove redundant condition check [cppcheck] libmount: avoid possible null pointer dereference [cppcheck] lib/mangle: fix possible null pointer dereference [cppcheck] sfdisk: remove unnecessary size check [cppcheck]
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/sulogin.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 549870d22..9091caf14 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -168,16 +168,17 @@ static void tcinit(struct console *con)
tio->c_cc[VMIN] = 1;
if (ioctl(fd, TIOCGWINSZ, &ws) == 0) {
- int set = 0;
+ int update = 0;
+
if (ws.ws_row == 0) {
ws.ws_row = 24;
- set++;
+ update++;
}
if (ws.ws_col == 0) {
ws.ws_col = 80;
- set++;
+ update++;
}
- if (set)
+ if (update)
ignore_result( ioctl(fd, TIOCSWINSZ, &ws) );
}