1
0
forked from pool/util-linux
util-linux/agetty-on-s390-on-dev-3270-tty1-line.patch
Stephan Kulow 1383751f43 Accepting request 220785 from Base:System
- Modify patch agetty-on-s390-on-dev--3270-tty1-line.patch and
  patch tty3270-on-serial-line-of-s390.patch to handle 3270
  terminals 
- Really do not verify /usr/bin/eject

- Add patch agetty-on-s390-on-dev--3270-tty1-line.patch
  to let agetty detect /dev/3270/tty1 as device not as baud rate

OBS-URL: https://build.opensuse.org/request/show/220785
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=178
2014-02-06 06:06:46 +00:00

38 lines
1.1 KiB
Diff

Be aware that on s390 the 3270 terminal line is found at
/dev/3270/tty<X>. That is that the baud speed rate numbers
have to be identified in a unique way.
---
agetty.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- term-utils/agetty.c
+++ term-utils/agetty.c 2014-02-04 09:33:13.162735763 +0000
@@ -568,6 +568,8 @@ static void login_options_to_argv(char *
*argc = i;
}
+#define is_speed(str) (strlen((str)) == strspn((str), "0123456789,"))
+
/* Parse command-line arguments. */
static void parse_args(int argc, char **argv, struct options *op)
{
@@ -746,7 +748,7 @@ static void parse_args(int argc, char **
}
/* Accept "tty", "baudrate tty", and "tty baudrate". */
- if ('0' <= argv[optind][0] && argv[optind][0] <= '9') {
+ if (is_speed(argv[optind])) {
/* Assume BSD style speed. */
parse_speeds(op, argv[optind++]);
if (argc < optind + 1) {
@@ -758,7 +760,7 @@ static void parse_args(int argc, char **
op->tty = argv[optind++];
if (argc > optind) {
char *v = argv[optind++];
- if ('0' <= *v && *v <= '9')
+ if (is_speed(v))
parse_speeds(op, v);
else
op->speeds[op->numspeed++] = bcode("9600");