coreutils/stty.c set_window_size() returns 0 on error
Bakonyi Ferenc
bakonyi.ferenc at gmail.com
Wed Mar 4 09:31:35 UTC 2020
Hi all,
stty from GNU coreutils returns 1 on error:
localhost:~$ stty -F /dev/tty1 rows 999
stty: /dev/tty1: Invalid argument
localhost:~$ echo $?
1
While busybox stty returns 0:
localhost:~$ busybox stty -F /dev/tty1 rows 999
stty: /dev/tty1: Invalid argument
localhost:~$ echo $?
0
Suggested patch:
diff -u a/coreutils/stty.c b/coreutils/stty.c
--- a/coreutils/stty.c 2019-06-10 10:50:53.000000000 +0000
+++ b/coreutils/stty.c 2020-03-03 22:47:15.234204337 +0000
@@ -886,7 +886,7 @@
if (ioctl(STDIN_FILENO, TIOCSWINSZ, (char *) &win))
bail:
- perror_on_device("%s");
+ perror_on_device_and_die("%s");
}
#endif
--
Kind regards,
Ferenc Bakonyi
More information about the busybox
mailing list