summaryrefslogtreecommitdiff
path: root/networking/telnetd.c
diff options
context:
space:
mode:
authorRob Landley2006-08-28 09:41:49 +0000
committerRob Landley2006-08-28 09:41:49 +0000
commit099ed50f911b61a1591a319df0d16ce0faaa5769 (patch)
treeb9c41eda94f7fdf8bb54e5fe60dcea594c726c93 /networking/telnetd.c
parentf78ab5396d57512fdada5c7ad6fc917d9a88c52a (diff)
downloadbusybox-099ed50f911b61a1591a319df0d16ce0faaa5769.zip
busybox-099ed50f911b61a1591a319df0d16ce0faaa5769.tar.gz
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.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 9f0eedc..87f44ce 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -24,28 +24,15 @@
/*#define DEBUG 1 */
#undef DEBUG
-#include <sys/socket.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <signal.h>
-#include <termios.h>
+#include "busybox.h"
+
#ifdef DEBUG
#define TELCMDS
#define TELOPTS
#endif
#include <arpa/telnet.h>
-#include <ctype.h>
#include <sys/syslog.h>
-#include "busybox.h"
#define BUFSIZE 4000
@@ -443,7 +430,7 @@ telnetd_main(int argc, char **argv)
/* Grab a TCP socket. */
- master_fd = bb_xsocket(SOCKET_TYPE, SOCK_STREAM, 0);
+ master_fd = xsocket(SOCKET_TYPE, SOCK_STREAM, 0);
(void)setsockopt(master_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
/* Set it to listen to specified port. */
@@ -459,9 +446,9 @@ telnetd_main(int argc, char **argv)
sa.sin_addr = bind_addr;
#endif
- bb_xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
- bb_xlisten(master_fd, 1);
- bb_xdaemon(0, 0);
+ xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
+ xlisten(master_fd, 1);
+ xdaemon(0, 0);
maxfd = master_fd;
#endif /* CONFIG_FEATURE_TELNETD_INETD */