Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/coreutils/stty.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/coreutils/stty.c

    r2725 r3232  
    2222   */
    2323
     24//usage:#define stty_trivial_usage
     25//usage:       "[-a|g] [-F DEVICE] [SETTING]..."
     26//usage:#define stty_full_usage "\n\n"
     27//usage:       "Without arguments, prints baud rate, line discipline,\n"
     28//usage:       "and deviations from stty sane\n"
     29//usage:     "\n    -F DEVICE   Open device instead of stdin"
     30//usage:     "\n    -a      Print all current settings in human-readable form"
     31//usage:     "\n    -g      Print in stty-readable form"
     32//usage:     "\n    [SETTING]   See manpage"
     33
    2434#include "libbb.h"
    2535
     
    5969#if defined(VEOL2) && !defined(CEOL2)
    6070# define CEOL2 _POSIX_VDISABLE
     71#endif
     72/* glibc-2.12.1 uses only VSWTC name */
     73#if defined(VSWTC) && !defined(VSWTCH)
     74# define VSWTCH VSWTC
    6175#endif
    6276/* ISC renamed swtch to susp for termios, but we'll accept either name */
     
    221235#ifndef XCASE
    222236# define XCASE 0
     237#endif
     238#ifndef IUTF8
     239# define IUTF8 0
    223240#endif
    224241
     
    339356    MI_ENTRY("ixon",     input,       REV,               IXON,       0 )
    340357    MI_ENTRY("ixoff",    input,       SANE_UNSET | REV,  IXOFF,      0 )
    341     MI_ENTRY("tandem",   input,       REV        | OMIT, IXOFF,      0 )
     358    MI_ENTRY("tandem",   input,       OMIT       | REV, IXOFF,      0 )
    342359#if IUCLC
    343360    MI_ENTRY("iuclc",    input,       SANE_UNSET | REV,  IUCLC,      0 )
     
    348365#if IMAXBEL
    349366    MI_ENTRY("imaxbel",  input,       SANE_SET   | REV,  IMAXBEL,    0 )
     367#endif
     368#if IUTF8
     369    MI_ENTRY("iutf8",    input,       SANE_UNSET | REV,  IUTF8,      0 )
    350370#endif
    351371    MI_ENTRY("opost",    output,      SANE_SET   | REV,  OPOST,      0 )
     
    416436    MI_ENTRY("echo",     local,       SANE_SET   | REV,  ECHO,       0 )
    417437    MI_ENTRY("echoe",    local,       SANE_SET   | REV,  ECHOE,      0 )
    418     MI_ENTRY("crterase", local,       REV        | OMIT, ECHOE,      0 )
     438    MI_ENTRY("crterase", local,       OMIT       | REV, ECHOE,      0 )
    419439    MI_ENTRY("echok",    local,       SANE_SET   | REV,  ECHOK,      0 )
    420440    MI_ENTRY("echonl",   local,       SANE_UNSET | REV,  ECHONL,     0 )
     
    428448#if ECHOPRT
    429449    MI_ENTRY("echoprt",  local,       SANE_UNSET | REV,  ECHOPRT,    0 )
    430     MI_ENTRY("prterase", local,       REV | OMIT,        ECHOPRT,    0 )
     450    MI_ENTRY("prterase", local,       OMIT       | REV,  ECHOPRT,    0 )
    431451#endif
    432452#if ECHOCTL
    433453    MI_ENTRY("echoctl",  local,       SANE_SET   | REV,  ECHOCTL,    0 )
    434     MI_ENTRY("ctlecho",  local,       REV        | OMIT, ECHOCTL,    0 )
     454    MI_ENTRY("ctlecho",  local,       OMIT       | REV, ECHOCTL,    0 )
    435455#endif
    436456#if ECHOKE
    437457    MI_ENTRY("echoke",   local,       SANE_SET   | REV,  ECHOKE,     0 )
    438     MI_ENTRY("crtkill",  local,       REV        | OMIT, ECHOKE,     0 )
     458    MI_ENTRY("crtkill",  local,       OMIT       | REV, ECHOKE,     0 )
    439459#endif
    440460    ;
     
    493513    MI_ENTRY("ixon",     input,       REV,               IXON,       0 )
    494514    MI_ENTRY("ixoff",    input,       SANE_UNSET | REV,  IXOFF,      0 )
    495     MI_ENTRY("tandem",   input,       REV        | OMIT, IXOFF,      0 )
     515    MI_ENTRY("tandem",   input,       OMIT       | REV, IXOFF,      0 )
    496516#if IUCLC
    497517    MI_ENTRY("iuclc",    input,       SANE_UNSET | REV,  IUCLC,      0 )
     
    502522#if IMAXBEL
    503523    MI_ENTRY("imaxbel",  input,       SANE_SET   | REV,  IMAXBEL,    0 )
     524#endif
     525#if IUTF8
     526    MI_ENTRY("iutf8",    input,       SANE_UNSET | REV,  IUTF8,      0 )
    504527#endif
    505528    MI_ENTRY("opost",    output,      SANE_SET   | REV,  OPOST,      0 )
     
    570593    MI_ENTRY("echo",     local,       SANE_SET   | REV,  ECHO,       0 )
    571594    MI_ENTRY("echoe",    local,       SANE_SET   | REV,  ECHOE,      0 )
    572     MI_ENTRY("crterase", local,       REV        | OMIT, ECHOE,      0 )
     595    MI_ENTRY("crterase", local,       OMIT       | REV, ECHOE,      0 )
    573596    MI_ENTRY("echok",    local,       SANE_SET   | REV,  ECHOK,      0 )
    574597    MI_ENTRY("echonl",   local,       SANE_UNSET | REV,  ECHONL,     0 )
     
    582605#if ECHOPRT
    583606    MI_ENTRY("echoprt",  local,       SANE_UNSET | REV,  ECHOPRT,    0 )
    584     MI_ENTRY("prterase", local,       REV | OMIT,        ECHOPRT,    0 )
     607    MI_ENTRY("prterase", local,       OMIT       | REV,  ECHOPRT,    0 )
    585608#endif
    586609#if ECHOCTL
    587610    MI_ENTRY("echoctl",  local,       SANE_SET   | REV,  ECHOCTL,    0 )
    588     MI_ENTRY("ctlecho",  local,       REV        | OMIT, ECHOCTL,    0 )
     611    MI_ENTRY("ctlecho",  local,       OMIT       | REV, ECHOCTL,    0 )
    589612#endif
    590613#if ECHOKE
    591614    MI_ENTRY("echoke",   local,       SANE_SET   | REV,  ECHOKE,     0 )
    592     MI_ENTRY("crtkill",  local,       REV        | OMIT, ECHOKE,     0 )
     615    MI_ENTRY("crtkill",  local,       OMIT       | REV, ECHOKE,     0 )
    593616#endif
    594617};
     
    9921015    unsigned long ispeed, ospeed;
    9931016
    994     ospeed = ispeed = cfgetispeed(mode);
    995     if (ispeed == 0 || ispeed == (ospeed = cfgetospeed(mode))) {
     1017    ispeed = cfgetispeed(mode);
     1018    ospeed = cfgetospeed(mode);
     1019    if (ispeed == 0 || ispeed == ospeed) {
    9961020        ispeed = ospeed;                /* in case ispeed was 0 */
    9971021        //________ 0123 4 5 6 7 8 9
     
    10121036    if (all)
    10131037        display_window_size(1);
    1014 #ifdef HAVE_C_LINE
     1038#ifdef __linux__
    10151039    wrapf("line = %u;\n", mode->c_line);
    10161040#else
     
    10331057#endif
    10341058        wrapf("%s = %s;", nth_string(control_name, i),
    1035               visible(mode->c_cc[control_info[i].offset]));
     1059                visible(mode->c_cc[control_info[i].offset]));
    10361060    }
    10371061#if VEOF == VMIN
     
    13451369
    13461370        switch (param) {
    1347 #ifdef HAVE_C_LINE
     1371#ifdef __linux__
    13481372        case param_line:
    13491373# ifndef TIOCGWINSZ
     
    13811405    /* Specifying both -a and -g is an error */
    13821406    if ((stty_state & (STTY_verbose_output | STTY_recoverable_output)) ==
    1383         (STTY_verbose_output | STTY_recoverable_output))
    1384         bb_error_msg_and_die("verbose and stty-readable output styles are mutually exclusive");
     1407        (STTY_verbose_output | STTY_recoverable_output)
     1408    ) {
     1409        bb_error_msg_and_die("-a and -g are mutually exclusive");
     1410    }
    13851411    /* Specifying -a or -g with non-options is an error */
    1386     if (!(stty_state & STTY_noargs)
    1387      && (stty_state & (STTY_verbose_output | STTY_recoverable_output))
     1412    if ((stty_state & (STTY_verbose_output | STTY_recoverable_output))
     1413     && !(stty_state & STTY_noargs)
    13881414    ) {
    1389         bb_error_msg_and_die("modes may not be set when specifying an output style");
     1415        bb_error_msg_and_die("modes may not be set when -a or -g is used");
    13901416    }
    13911417
     
    14491475
    14501476        switch (param) {
    1451 #ifdef HAVE_C_LINE
     1477#ifdef __linux__
    14521478        case param_line:
    14531479            mode.c_line = xatoul_sfx(argnext, stty_suffixes);
Note: See TracChangeset for help on using the changeset viewer.