diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-22 23:22:06 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-22 23:22:06 +0000 |
commit | 48237b0c88343154d58854020c3a9c8b07c61b10 (patch) | |
tree | b36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/inetd.c | |
parent | b40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff) | |
download | busybox-w32-48237b0c88343154d58854020c3a9c8b07c61b10.tar.gz busybox-w32-48237b0c88343154d58854020c3a9c8b07c61b10.tar.bz2 busybox-w32-48237b0c88343154d58854020c3a9c8b07c61b10.zip |
introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
Diffstat (limited to 'networking/inetd.c')
-rw-r--r-- | networking/inetd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 75b2b14a7..ec7b2e8f7 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -419,7 +419,6 @@ static int bump_nofile (void) | |||
419 | 419 | ||
420 | static void setup(servtab_t *sep) | 420 | static void setup(servtab_t *sep) |
421 | { | 421 | { |
422 | int on = 1; | ||
423 | int r; | 422 | int r; |
424 | 423 | ||
425 | sep->se_fd = socket(sep->se_family, sep->se_socktype, 0); | 424 | sep->se_fd = socket(sep->se_family, sep->se_socktype, 0); |
@@ -427,11 +426,8 @@ static void setup(servtab_t *sep) | |||
427 | bb_perror_msg("%s/%s: socket", sep->se_service, sep->se_proto); | 426 | bb_perror_msg("%s/%s: socket", sep->se_service, sep->se_proto); |
428 | return; | 427 | return; |
429 | } | 428 | } |
430 | #define turnon(fd, opt) \ | 429 | if (setsockopt_reuseaddr(sep->se_fd) < 0) |
431 | setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof(on)) | ||
432 | if (turnon(sep->se_fd, SO_REUSEADDR) < 0) | ||
433 | bb_perror_msg("setsockopt(SO_REUSEADDR)"); | 430 | bb_perror_msg("setsockopt(SO_REUSEADDR)"); |
434 | #undef turnon | ||
435 | 431 | ||
436 | #ifdef CONFIG_FEATURE_INETD_RPC | 432 | #ifdef CONFIG_FEATURE_INETD_RPC |
437 | if (isrpcservice(sep)) { | 433 | if (isrpcservice(sep)) { |