Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/console-tools/resize.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1122 by niro, Fri Apr 24 18:33:46 2009 UTC revision 1123 by niro, Wed Aug 18 21:56:57 2010 UTC
# Line 11  Line 11 
11    
12  #define ESC "\033"  #define ESC "\033"
13    
14  #define old_termios (*(struct termios*)&bb_common_bufsiz1)  #define old_termios_p ((struct termios*)&bb_common_bufsiz1)
15    
16  static void  static void
17  onintr(int sig UNUSED_PARAM)  onintr(int sig UNUSED_PARAM)
18  {  {
19   tcsetattr(STDERR_FILENO, TCSANOW, &old_termios);   tcsetattr(STDERR_FILENO, TCSANOW, old_termios_p);
20   exit(EXIT_FAILURE);   exit(EXIT_FAILURE);
21  }  }
22    
# Line 33  int resize_main(int argc UNUSED_PARAM, c Line 33  int resize_main(int argc UNUSED_PARAM, c
33   * and operate on it - should we do the same?   * and operate on it - should we do the same?
34   */   */
35    
36   tcgetattr(STDERR_FILENO, &old_termios); /* fiddle echo */   tcgetattr(STDERR_FILENO, old_termios_p); /* fiddle echo */
37   new = old_termios;   memcpy(&new, old_termios_p, sizeof(new));
38   new.c_cflag |= (CLOCAL | CREAD);   new.c_cflag |= (CLOCAL | CREAD);
39   new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);   new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
40   bb_signals(0   bb_signals(0
# Line 61  int resize_main(int argc UNUSED_PARAM, c Line 61  int resize_main(int argc UNUSED_PARAM, c
61   * (gotten via TIOCGWINSZ) and recomputing *pixel values */   * (gotten via TIOCGWINSZ) and recomputing *pixel values */
62   ret = ioctl(STDERR_FILENO, TIOCSWINSZ, &w);   ret = ioctl(STDERR_FILENO, TIOCSWINSZ, &w);
63    
64   tcsetattr(STDERR_FILENO, TCSANOW, &old_termios);   tcsetattr(STDERR_FILENO, TCSANOW, old_termios_p);
65    
66   if (ENABLE_FEATURE_RESIZE_PRINT)   if (ENABLE_FEATURE_RESIZE_PRINT)
67   printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n",   printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n",

Legend:
Removed from v.1122  
changed lines
  Added in v.1123