diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-08-03 15:41:12 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-08-03 15:41:12 +0000 |
commit | 5e2a5391f9142bca773aab4c829615895b69a6b7 (patch) | |
tree | e4a2769349867c441cf2983d83097bb66701a733 /coreutils/stty.c | |
parent | e883e03918a0e26e390ea23996abdb8fc1925f88 (diff) | |
download | busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.gz busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.bz2 busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.zip |
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)
git-svn-id: svn://busybox.net/trunk/busybox@15767 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r-- | coreutils/stty.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index b78368e7b..073de847b 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
@@ -21,31 +21,7 @@ | |||
21 | 21 | ||
22 | */ | 22 | */ |
23 | 23 | ||
24 | //#define TEST | ||
25 | |||
26 | #include "busybox.h" | 24 | #include "busybox.h" |
27 | #include <stddef.h> | ||
28 | #include <termios.h> | ||
29 | #include <sys/ioctl.h> | ||
30 | |||
31 | #include <sys/param.h> | ||
32 | #include <unistd.h> | ||
33 | |||
34 | #ifndef STDIN_FILENO | ||
35 | # define STDIN_FILENO 0 | ||
36 | #endif | ||
37 | |||
38 | #ifndef STDOUT_FILENO | ||
39 | # define STDOUT_FILENO 1 | ||
40 | #endif | ||
41 | |||
42 | #include <stdlib.h> | ||
43 | #include <string.h> | ||
44 | #include <assert.h> | ||
45 | #include <ctype.h> | ||
46 | #include <errno.h> | ||
47 | #include <limits.h> | ||
48 | #include <fcntl.h> | ||
49 | 25 | ||
50 | #define STREQ(a, b) (strcmp ((a), (b)) == 0) | 26 | #define STREQ(a, b) (strcmp ((a), (b)) == 0) |
51 | 27 | ||
@@ -469,11 +445,7 @@ static const struct suffix_mult stty_suffixes[] = { | |||
469 | {NULL, 0 } | 445 | {NULL, 0 } |
470 | }; | 446 | }; |
471 | 447 | ||
472 | #ifndef TEST | ||
473 | int stty_main(int argc, char **argv) | 448 | int stty_main(int argc, char **argv) |
474 | #else | ||
475 | int main(int argc, char **argv) | ||
476 | #endif | ||
477 | { | 449 | { |
478 | struct termios mode; | 450 | struct termios mode; |
479 | void (*output_func)(struct termios *); | 451 | void (*output_func)(struct termios *); |
@@ -541,7 +513,7 @@ int main(int argc, char **argv) | |||
541 | 513 | ||
542 | device_name = file_name; | 514 | device_name = file_name; |
543 | fclose(stdin); | 515 | fclose(stdin); |
544 | bb_xopen(device_name, O_RDONLY | O_NONBLOCK); | 516 | xopen(device_name, O_RDONLY | O_NONBLOCK); |
545 | if ((fdflags = fcntl(STDIN_FILENO, F_GETFL)) == -1 | 517 | if ((fdflags = fcntl(STDIN_FILENO, F_GETFL)) == -1 |
546 | || fcntl(STDIN_FILENO, F_SETFL, fdflags & ~O_NONBLOCK) < 0) | 518 | || fcntl(STDIN_FILENO, F_SETFL, fdflags & ~O_NONBLOCK) < 0) |
547 | perror_on_device("%s: couldn't reset non-blocking mode"); | 519 | perror_on_device("%s: couldn't reset non-blocking mode"); |
@@ -1299,9 +1271,3 @@ static const char *visible(unsigned int ch) | |||
1299 | *bpout = '\0'; | 1271 | *bpout = '\0'; |
1300 | return (const char *) buf; | 1272 | return (const char *) buf; |
1301 | } | 1273 | } |
1302 | |||
1303 | #ifdef TEST | ||
1304 | |||
1305 | const char *bb_applet_name = "stty"; | ||
1306 | |||
1307 | #endif | ||