Simplify variable declarations in main(), strip #ifdefs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
27027456b5
commit
56ff4eedbe
@ -862,44 +862,19 @@ static int *create_inet_sockets();
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
extern char *optarg;
|
||||||
|
extern int optind;
|
||||||
#ifndef TESTING
|
#ifndef TESTING
|
||||||
ssize_t msglen;
|
|
||||||
#endif
|
|
||||||
#if !defined(__GLIBC__)
|
|
||||||
int len, num_fds;
|
|
||||||
#else /* __GLIBC__ */
|
|
||||||
#ifndef TESTING
|
|
||||||
socklen_t len;
|
|
||||||
#endif
|
|
||||||
int num_fds;
|
|
||||||
#endif /* __GLIBC__ */
|
|
||||||
/*
|
|
||||||
* It took me quite some time to figure out how this is
|
|
||||||
* supposed to work so I guess I should better write it down.
|
|
||||||
* unixm is a list of file descriptors from which one can
|
|
||||||
* read(). This is in contrary to readfds which is a list of
|
|
||||||
* file descriptors where activity is monitored by select()
|
|
||||||
* and from which one cannot read(). -Joey
|
|
||||||
*
|
|
||||||
* Changed: unixm is gone, since we now use datagram unix sockets.
|
|
||||||
* Hence we recv() from unix sockets directly (rather than
|
|
||||||
* first accept()ing connections on them), so there's no need
|
|
||||||
* for separate book-keeping. --okir
|
|
||||||
*/
|
|
||||||
fd_set readfds;
|
|
||||||
|
|
||||||
#ifndef TESTING
|
|
||||||
int fd;
|
|
||||||
struct sockaddr_storage frominet;
|
struct sockaddr_storage frominet;
|
||||||
pid_t ppid = getpid();
|
pid_t ppid = getpid();
|
||||||
|
socklen_t len;
|
||||||
|
ssize_t msglen;
|
||||||
|
int fd;
|
||||||
#endif
|
#endif
|
||||||
int ch;
|
fd_set readfds;
|
||||||
|
|
||||||
char line[MAXLINE + 1];
|
char line[MAXLINE + 1];
|
||||||
extern int optind;
|
int num_fds, maxfds;
|
||||||
extern char *optarg;
|
int i, ch;
|
||||||
int maxfds;
|
|
||||||
|
|
||||||
#ifndef TESTING
|
#ifndef TESTING
|
||||||
chdir("/");
|
chdir("/");
|
||||||
|
Loading…
Reference in New Issue
Block a user