diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-17 19:44:59 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-17 19:44:59 +0000 |
commit | 4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16 (patch) | |
tree | 480af962646153007f7aca329528d27eda808838 | |
parent | 21fc740023b8cdaad68cbae1899dc9fc95f025b6 (diff) | |
download | busybox-w32-4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16.tar.gz busybox-w32-4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16.tar.bz2 busybox-w32-4950f010f3cf7f37dd31ae5c97b52e0fb28f3d16.zip |
- manually inline tty_value_to_baud and remove string_to_baud_or_die
(cleanup)
-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): |