Unbreak allbareconfig a bit. (The telnetd.c fix is a perfect example of why
applets which are a forest of #ifdefs are unmaintainable.)
This commit is contained in:
@ -130,6 +130,7 @@
|
|||||||
|
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
|
||||||
//#define CONFIG_FEATURE_INETD_RPC
|
//#define CONFIG_FEATURE_INETD_RPC
|
||||||
//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
|
//#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
|
||||||
|
@ -24,28 +24,15 @@
|
|||||||
/*#define DEBUG 1 */
|
/*#define DEBUG 1 */
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include "busybox.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>
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define TELCMDS
|
#define TELCMDS
|
||||||
#define TELOPTS
|
#define TELOPTS
|
||||||
#endif
|
#endif
|
||||||
#include <arpa/telnet.h>
|
#include <arpa/telnet.h>
|
||||||
#include <ctype.h>
|
|
||||||
#include <sys/syslog.h>
|
#include <sys/syslog.h>
|
||||||
|
|
||||||
#include "busybox.h"
|
|
||||||
|
|
||||||
#define BUFSIZE 4000
|
#define BUFSIZE 4000
|
||||||
|
|
||||||
@ -443,7 +430,7 @@ telnetd_main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Grab a TCP socket. */
|
/* 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));
|
(void)setsockopt(master_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||||
|
|
||||||
/* Set it to listen to specified port. */
|
/* Set it to listen to specified port. */
|
||||||
@ -459,9 +446,9 @@ telnetd_main(int argc, char **argv)
|
|||||||
sa.sin_addr = bind_addr;
|
sa.sin_addr = bind_addr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bb_xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
|
xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
|
||||||
bb_xlisten(master_fd, 1);
|
xlisten(master_fd, 1);
|
||||||
bb_xdaemon(0, 0);
|
xdaemon(0, 0);
|
||||||
|
|
||||||
maxfd = master_fd;
|
maxfd = master_fd;
|
||||||
#endif /* CONFIG_FEATURE_TELNETD_INETD */
|
#endif /* CONFIG_FEATURE_TELNETD_INETD */
|
||||||
|
Reference in New Issue
Block a user