~vcs-imports/busybox/main

« back to all changes in this revision

Viewing changes to networking/nc_bloaty.c

  • Committer: vda
  • Date: 2009-04-21 23:48:38 UTC
  • Revision ID: vcs-imports@canonical.com-20090421234838-00iy8q2ind54zttx
*: 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

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
         random unknown port is probably not very useful without "netstat". */
279
279
        if (o_verbose) {
280
280
                char *addr;
281
 
                rr = getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
282
 
                if (rr < 0)
283
 
                        bb_perror_msg_and_die("getsockname after bind");
 
281
                getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
 
282
                //if (rr < 0)
 
283
                //      bb_perror_msg_and_die("getsockname after bind");
284
284
                addr = xmalloc_sockaddr2dotted(&ouraddr->u.sa);
285
285
                fprintf(stderr, "listening on %s ...\n", addr);
286
286
                free(addr);
359
359
                 doing a listen-on-any on a multihomed machine.  This allows one to
360
360
                 offer different services via different alias addresses, such as the
361
361
                 "virtual web site" hack. */
362
 
                rr = getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
363
 
                if (rr < 0)
364
 
                        bb_perror_msg_and_die("getsockname after accept");
 
362
                getsockname(netfd, &ouraddr->u.sa, &ouraddr->len);
 
363
                //if (rr < 0)
 
364
                //      bb_perror_msg_and_die("getsockname after accept");
365
365
        }
366
366
 
367
367
        if (o_verbose) {