*: remove check for errors on getsockaddr in cases we know they can't happen
libbb: make get_sock_lsa use only one getsockaddr syscall, not two function old new delta get_sock_lsa 72 101 +29 do_iplink 1151 1137 -14 arping_main 1585 1569 -16 dolisten 789 755 -34 xrtnl_open 161 94 -67
This commit is contained in:
@@ -278,9 +278,9 @@ static void dolisten(void)
|
||||
random unknown port is probably not very useful without "netstat". */
|
||||
if (o_verbose) {
|
||||
char *addr;
|
||||
rr = getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
|
||||
if (rr < 0)
|
||||
bb_perror_msg_and_die("getsockname after bind");
|
||||
getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
|
||||
//if (rr < 0)
|
||||
// bb_perror_msg_and_die("getsockname after bind");
|
||||
addr = xmalloc_sockaddr2dotted(&ouraddr->u.sa);
|
||||
fprintf(stderr, "listening on %s ...\n", addr);
|
||||
free(addr);
|
||||
@@ -359,9 +359,9 @@ create new one, and bind() it. TODO */
|
||||
doing a listen-on-any on a multihomed machine. This allows one to
|
||||
offer different services via different alias addresses, such as the
|
||||
"virtual web site" hack. */
|
||||
rr = getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
|
||||
if (rr < 0)
|
||||
bb_perror_msg_and_die("getsockname after accept");
|
||||
getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
|
||||
//if (rr < 0)
|
||||
// bb_perror_msg_and_die("getsockname after accept");
|
||||
}
|
||||
|
||||
if (o_verbose) {
|
||||
|
Reference in New Issue
Block a user