Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/console-tools/resize.c

    r1765 r2725  
    33 * resize - set terminal width and height.
    44 *
    5  * Copyright 2006 Bernhard Fischer
     5 * Copyright 2006 Bernhard Reutner-Fischer
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99/* no options, no getopt */
     
    1212#define ESC "\033"
    1313
    14 #define old_termios (*(struct termios*)&bb_common_bufsiz1)
     14#define old_termios_p ((struct termios*)&bb_common_bufsiz1)
    1515
    1616static void
    17 onintr(int sig ATTRIBUTE_UNUSED)
     17onintr(int sig UNUSED_PARAM)
    1818{
    19     tcsetattr(STDERR_FILENO, TCSANOW, &old_termios);
    20     exit(1);
     19    tcsetattr(STDERR_FILENO, TCSANOW, old_termios_p);
     20    _exit(EXIT_FAILURE);
    2121}
    2222
    23 int resize_main(int argc, char **argv);
    24 int resize_main(int argc, char **argv)
     23int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     24int resize_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
    2525{
    2626    struct termios new;
    27     struct winsize w = { 0,0,0,0 };
     27    struct winsize w = { 0, 0, 0, 0 };
    2828    int ret;
    2929
     
    3434     */
    3535
    36     tcgetattr(STDERR_FILENO, &old_termios); /* fiddle echo */
    37     new = old_termios;
     36    tcgetattr(STDERR_FILENO, old_termios_p); /* fiddle echo */
     37    memcpy(&new, old_termios_p, sizeof(new));
    3838    new.c_cflag |= (CLOCAL | CREAD);
    3939    new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
    40     signal(SIGINT, onintr);
    41     signal(SIGQUIT, onintr);
    42     signal(SIGTERM, onintr);
    43     signal(SIGALRM, onintr);
     40    bb_signals(0
     41        + (1 << SIGINT)
     42        + (1 << SIGQUIT)
     43        + (1 << SIGTERM)
     44        + (1 << SIGALRM)
     45        , onintr);
    4446    tcsetattr(STDERR_FILENO, TCSANOW, &new);
    4547
     
    6062    ret = ioctl(STDERR_FILENO, TIOCSWINSZ, &w);
    6163
    62     tcsetattr(STDERR_FILENO, TCSANOW, &old_termios);
     64    tcsetattr(STDERR_FILENO, TCSANOW, old_termios_p);
    6365
    6466    if (ENABLE_FEATURE_RESIZE_PRINT)
Note: See TracChangeset for help on using the changeset viewer.