diff options
author | Rob Landley <rob@landley.net> | 2006-08-28 09:41:49 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-08-28 09:41:49 +0000 |
commit | 099ed50f911b61a1591a319df0d16ce0faaa5769 (patch) | |
tree | b9c41eda94f7fdf8bb54e5fe60dcea594c726c93 /networking/telnetd.c | |
parent | f78ab5396d57512fdada5c7ad6fc917d9a88c52a (diff) | |
download | busybox-w32-099ed50f911b61a1591a319df0d16ce0faaa5769.tar.gz busybox-w32-099ed50f911b61a1591a319df0d16ce0faaa5769.tar.bz2 busybox-w32-099ed50f911b61a1591a319df0d16ce0faaa5769.zip |
Unbreak allbareconfig a bit. (The telnetd.c fix is a perfect example of why
applets which are a forest of #ifdefs are unmaintainable.)
Diffstat (limited to 'networking/telnetd.c')
-rw-r--r-- | networking/telnetd.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index 9f0eedcc8..87f44ce51 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -24,28 +24,15 @@ | |||
24 | /*#define DEBUG 1 */ | 24 | /*#define DEBUG 1 */ |
25 | #undef DEBUG | 25 | #undef DEBUG |
26 | 26 | ||
27 | #include <sys/socket.h> | 27 | #include "busybox.h" |
28 | #include <sys/wait.h> | 28 | |
29 | #include <sys/ioctl.h> | ||
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
32 | #include <unistd.h> | ||
33 | #include <errno.h> | ||
34 | #include <netinet/in.h> | ||
35 | #include <arpa/inet.h> | ||
36 | #include <fcntl.h> | ||
37 | #include <stdio.h> | ||
38 | #include <signal.h> | ||
39 | #include <termios.h> | ||
40 | #ifdef DEBUG | 29 | #ifdef DEBUG |
41 | #define TELCMDS | 30 | #define TELCMDS |
42 | #define TELOPTS | 31 | #define TELOPTS |
43 | #endif | 32 | #endif |
44 | #include <arpa/telnet.h> | 33 | #include <arpa/telnet.h> |
45 | #include <ctype.h> | ||
46 | #include <sys/syslog.h> | 34 | #include <sys/syslog.h> |
47 | 35 | ||
48 | #include "busybox.h" | ||
49 | 36 | ||
50 | #define BUFSIZE 4000 | 37 | #define BUFSIZE 4000 |
51 | 38 | ||
@@ -443,7 +430,7 @@ telnetd_main(int argc, char **argv) | |||
443 | 430 | ||
444 | /* Grab a TCP socket. */ | 431 | /* Grab a TCP socket. */ |
445 | 432 | ||
446 | master_fd = bb_xsocket(SOCKET_TYPE, SOCK_STREAM, 0); | 433 | master_fd = xsocket(SOCKET_TYPE, SOCK_STREAM, 0); |
447 | (void)setsockopt(master_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); | 434 | (void)setsockopt(master_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); |
448 | 435 | ||
449 | /* Set it to listen to specified port. */ | 436 | /* Set it to listen to specified port. */ |
@@ -459,9 +446,9 @@ telnetd_main(int argc, char **argv) | |||
459 | sa.sin_addr = bind_addr; | 446 | sa.sin_addr = bind_addr; |
460 | #endif | 447 | #endif |
461 | 448 | ||
462 | bb_xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa)); | 449 | xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa)); |
463 | bb_xlisten(master_fd, 1); | 450 | xlisten(master_fd, 1); |
464 | bb_xdaemon(0, 0); | 451 | xdaemon(0, 0); |
465 | 452 | ||
466 | maxfd = master_fd; | 453 | maxfd = master_fd; |
467 | #endif /* CONFIG_FEATURE_TELNETD_INETD */ | 454 | #endif /* CONFIG_FEATURE_TELNETD_INETD */ |