diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-03 22:30:22 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-03 22:30:22 +0000 |
commit | 4e5f82c76f08614d0b69f9ec4a8baac303af15f6 (patch) | |
tree | 5eb42f026a1fb90ae72b27b7a9b700cd5fee3ab9 /console-tools | |
parent | dd6e1f0deb6c0423b803137ca650cd85eaa570b3 (diff) | |
download | busybox-w32-4e5f82c76f08614d0b69f9ec4a8baac303af15f6.tar.gz busybox-w32-4e5f82c76f08614d0b69f9ec4a8baac303af15f6.tar.bz2 busybox-w32-4e5f82c76f08614d0b69f9ec4a8baac303af15f6.zip |
find_stray_communal_vars: script which finds communal variables
resize: remove globals var
mdev: remove globals var
Diffstat (limited to 'console-tools')
-rw-r--r-- | console-tools/resize.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/console-tools/resize.c b/console-tools/resize.c index 52fdb26f4..32551b2f2 100644 --- a/console-tools/resize.c +++ b/console-tools/resize.c | |||
@@ -11,16 +11,15 @@ | |||
11 | 11 | ||
12 | #define ESC "\033" | 12 | #define ESC "\033" |
13 | 13 | ||
14 | struct termios old; | 14 | #define old_termios (*(struct termios*)&bb_common_bufsiz1) |
15 | 15 | ||
16 | static void | 16 | static void |
17 | onintr(int sig ATTRIBUTE_UNUSED) | 17 | onintr(int sig ATTRIBUTE_UNUSED) |
18 | { | 18 | { |
19 | tcsetattr(STDERR_FILENO, TCSANOW, &old); | 19 | tcsetattr(STDERR_FILENO, TCSANOW, &old_termios); |
20 | exit(1); | 20 | exit(1); |
21 | } | 21 | } |
22 | 22 | ||
23 | |||
24 | int resize_main(int argc, char **argv); | 23 | int resize_main(int argc, char **argv); |
25 | int resize_main(int argc, char **argv) | 24 | int resize_main(int argc, char **argv) |
26 | { | 25 | { |
@@ -34,8 +33,8 @@ int resize_main(int argc, char **argv) | |||
34 | * and operate on it - should we do the same? | 33 | * and operate on it - should we do the same? |
35 | */ | 34 | */ |
36 | 35 | ||
37 | tcgetattr(STDERR_FILENO, &old); /* fiddle echo */ | 36 | tcgetattr(STDERR_FILENO, &old_termios); /* fiddle echo */ |
38 | new = old; | 37 | new = old_termios; |
39 | new.c_cflag |= (CLOCAL | CREAD); | 38 | new.c_cflag |= (CLOCAL | CREAD); |
40 | new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); | 39 | new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); |
41 | signal(SIGINT, onintr); | 40 | signal(SIGINT, onintr); |
@@ -60,7 +59,7 @@ int resize_main(int argc, char **argv) | |||
60 | * (gotten via TIOCGWINSZ) and recomputing *pixel values */ | 59 | * (gotten via TIOCGWINSZ) and recomputing *pixel values */ |
61 | ret = ioctl(STDERR_FILENO, TIOCSWINSZ, &w); | 60 | ret = ioctl(STDERR_FILENO, TIOCSWINSZ, &w); |
62 | 61 | ||
63 | tcsetattr(STDERR_FILENO, TCSANOW, &old); | 62 | tcsetattr(STDERR_FILENO, TCSANOW, &old_termios); |
64 | 63 | ||
65 | if (ENABLE_FEATURE_RESIZE_PRINT) | 64 | if (ENABLE_FEATURE_RESIZE_PRINT) |
66 | printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n", | 65 | printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n", |