diff options
author | Bernhard Reutner-Fischer | 2007-01-17 19:44:59 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer | 2007-01-17 19:44:59 +0000 |
commit | 4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16 (patch) | |
tree | 480af962646153007f7aca329528d27eda808838 /coreutils/stty.c | |
parent | 21fc740023b8cdaad68cbae1899dc9fc95f025b6 (diff) | |
download | busybox-4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16.zip busybox-4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16.tar.gz |
- manually inline tty_value_to_baud and remove string_to_baud_or_die
(cleanup)
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r-- | coreutils/stty.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 60e4855..4d7d066 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -425,17 +425,12 @@ static tcflag_t *mode_type_flag(unsigned type, const struct termios *mode) return NULL; } -static speed_t string_to_baud_or_die(const char *arg) -{ - return tty_value_to_baud(xatou(arg)); -} - -static void set_speed_or_die(enum speed_setting type, const char *arg, - struct termios *mode) +static void set_speed_or_die(enum speed_setting type, const char * const arg, + struct termios * const mode) { speed_t baud; - baud = string_to_baud_or_die(arg); + baud = tty_value_to_baud(xatou(arg)); if (type != output_speed) { /* either input or both */ cfsetispeed(mode, baud); @@ -1130,7 +1125,7 @@ end_option: break; default: if (recover_mode(arg, &mode) == 1) break; - if (string_to_baud_or_die(arg) != (speed_t) -1) break; + if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) break; invalid_argument: bb_error_msg_and_die("invalid argument '%s'", arg); } @@ -1244,7 +1239,7 @@ invalid_argument: default: if (recover_mode(arg, &mode) == 1) option_mask32 |= STTY_require_set_attr; - else /* true: if (string_to_baud_or_die(arg) != (speed_t) -1) */ { + else /* true: if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) */{ set_speed_or_die(both_speeds, arg, &mode); option_mask32 |= (STTY_require_set_attr | STTY_speed_was_set); } /* else - impossible (caught in the first pass): |