diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-17 19:44:59 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-17 19:44:59 +0000 |
| commit | b2fa34ffe75981c8b414ae69c6f74dc006fa49e4 (patch) | |
| tree | 480af962646153007f7aca329528d27eda808838 /coreutils | |
| parent | b838998e127d1d8da442ed74d74b76fefba87320 (diff) | |
| download | busybox-w32-b2fa34ffe75981c8b414ae69c6f74dc006fa49e4.tar.gz busybox-w32-b2fa34ffe75981c8b414ae69c6f74dc006fa49e4.tar.bz2 busybox-w32-b2fa34ffe75981c8b414ae69c6f74dc006fa49e4.zip | |
- manually inline tty_value_to_baud and remove string_to_baud_or_die
(cleanup)
git-svn-id: svn://busybox.net/trunk/busybox@17350 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
| -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 60e485585..4d7d0660a 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) | |||
| 425 | return NULL; | 425 | return NULL; |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | static speed_t string_to_baud_or_die(const char *arg) | 428 | static void set_speed_or_die(enum speed_setting type, const char * const arg, |
| 429 | { | 429 | struct termios * const mode) |
| 430 | return tty_value_to_baud(xatou(arg)); | ||
| 431 | } | ||
| 432 | |||
| 433 | static void set_speed_or_die(enum speed_setting type, const char *arg, | ||
| 434 | struct termios *mode) | ||
| 435 | { | 430 | { |
| 436 | speed_t baud; | 431 | speed_t baud; |
| 437 | 432 | ||
| 438 | baud = string_to_baud_or_die(arg); | 433 | baud = tty_value_to_baud(xatou(arg)); |
| 439 | 434 | ||
| 440 | if (type != output_speed) { /* either input or both */ | 435 | if (type != output_speed) { /* either input or both */ |
| 441 | cfsetispeed(mode, baud); | 436 | cfsetispeed(mode, baud); |
| @@ -1130,7 +1125,7 @@ end_option: | |||
| 1130 | break; | 1125 | break; |
| 1131 | default: | 1126 | default: |
| 1132 | if (recover_mode(arg, &mode) == 1) break; | 1127 | if (recover_mode(arg, &mode) == 1) break; |
| 1133 | if (string_to_baud_or_die(arg) != (speed_t) -1) break; | 1128 | if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) break; |
| 1134 | invalid_argument: | 1129 | invalid_argument: |
| 1135 | bb_error_msg_and_die("invalid argument '%s'", arg); | 1130 | bb_error_msg_and_die("invalid argument '%s'", arg); |
| 1136 | } | 1131 | } |
| @@ -1244,7 +1239,7 @@ invalid_argument: | |||
| 1244 | default: | 1239 | default: |
| 1245 | if (recover_mode(arg, &mode) == 1) | 1240 | if (recover_mode(arg, &mode) == 1) |
| 1246 | option_mask32 |= STTY_require_set_attr; | 1241 | option_mask32 |= STTY_require_set_attr; |
| 1247 | else /* true: if (string_to_baud_or_die(arg) != (speed_t) -1) */ { | 1242 | else /* true: if (tty_value_to_baud(xatou(arg)) != (speed_t) -1) */{ |
| 1248 | set_speed_or_die(both_speeds, arg, &mode); | 1243 | set_speed_or_die(both_speeds, arg, &mode); |
| 1249 | option_mask32 |= (STTY_require_set_attr | STTY_speed_was_set); | 1244 | option_mask32 |= (STTY_require_set_attr | STTY_speed_was_set); |
| 1250 | } /* else - impossible (caught in the first pass): | 1245 | } /* else - impossible (caught in the first pass): |
