[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    coreutils/stty.c set_window_size() returns 0 on error
From:       Bakonyi Ferenc <bakonyi.ferenc () gmail ! com>
Date:       2020-03-04 9:31:35
Message-ID: 20200304103718.9QSsjmLYObokr9QSsjnSo6 () vie01a-pemc-psmtp-pe11 ! mail ! upcmail ! net
[Download RAW message or body]

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 
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic