aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-04-18 18:52:15 +0000
committerMike Frysinger <vapier@gentoo.org>2005-04-18 18:52:15 +0000
commit91d8f0e892edd12e198641ab47b7deb6856a68b5 (patch)
tree276ff911aa54336fdfc6f06adf478675c00e1f41
parentef614ecca61c54eec55b95828512d56a249d5b44 (diff)
downloadbusybox-w32-91d8f0e892edd12e198641ab47b7deb6856a68b5.tar.gz
busybox-w32-91d8f0e892edd12e198641ab47b7deb6856a68b5.tar.bz2
busybox-w32-91d8f0e892edd12e198641ab47b7deb6856a68b5.zip
touchups as suggested by Vladimir N. Oleynik
-rw-r--r--networking/fakeidentd.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c
index 560f6bab0..a7cf4d11e 100644
--- a/networking/fakeidentd.c
+++ b/networking/fakeidentd.c
@@ -74,14 +74,14 @@ static const int ident_substr_len = sizeof(ident_substr) - 1;
74 * FD of the connection is always the index of the connection structure 74 * FD of the connection is always the index of the connection structure
75 * in `conns' array + FCS 75 * in `conns' array + FCS
76 */ 76 */
77struct { 77static struct {
78 char buf[20]; 78 char buf[20];
79 int len; 79 int len;
80 time_t lasttime; 80 time_t lasttime;
81} conns[MAXCONNS]; 81} conns[MAXCONNS];
82 82
83/* When using global variables, bind those at least to a structure. */ 83/* When using global variables, bind those at least to a structure. */
84struct { 84static struct {
85 const char *identuser; 85 const char *identuser;
86 fd_set readfds; 86 fd_set readfds;
87 int conncnt; 87 int conncnt;
@@ -274,15 +274,7 @@ int fakeidentd_main(int argc, char **argv)
274 FD_SET(0, &G.readfds); 274 FD_SET(0, &G.readfds);
275 275
276 /* handle -b <ip> parameter */ 276 /* handle -b <ip> parameter */
277 while ((flag = getopt(argc, argv, "b:")) != EOF) { 277 bb_getopt_ulflags(argc, argv, "b:", &bind_ip_address);
278 switch (flag) {
279 case 'b':
280 bind_ip_address = optarg;
281 break;
282 default:
283 bb_show_usage();
284 }
285 }
286 /* handle optional REPLY STRING */ 278 /* handle optional REPLY STRING */
287 if (optind < argc) 279 if (optind < argc)
288 G.identuser = argv[optind]; 280 G.identuser = argv[optind];
@@ -293,6 +285,7 @@ int fakeidentd_main(int argc, char **argv)
293 if (godaemon() == 0) 285 if (godaemon() == 0)
294 return 0; 286 return 0;
295 287
288 /* main loop where we process all events and never exit */
296 while (1) { 289 while (1) {
297 fd_set rfds = G.readfds; 290 fd_set rfds = G.readfds;
298 struct timeval tv = { 15, 0 }; 291 struct timeval tv = { 15, 0 };