diff options
-rw-r--r-- | networking/fakeidentd.c | 15 |
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 | */ |
77 | struct { | 77 | static 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. */ |
84 | struct { | 84 | static 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 }; |