aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /coreutils/stty.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.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.)
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r--coreutils/stty.c36
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
473int stty_main(int argc, char **argv) 448int stty_main(int argc, char **argv)
474#else
475int 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
1305const char *bb_applet_name = "stty";
1306
1307#endif