On Sun, Dec 07, 2014 at 06:56:13AM +0900, Masatake YAMATO wrote:
[...]
> --- a/socketutils.c
> +++ b/socketutils.c
> @@ -138,33 +138,56 @@ receive_responses(const int fd, const unsigned long 
> inode)
>       }
>  }
>  
> +static bool
> +inet_print(int fd, int family, int protocol, const unsigned long inode)
> +{
> +     if (!send_query(fd, family, protocol))
> +             return false;
> +     if (receive_responses(fd, inode))
> +             return true;
> +     return false;
> +}

You can simply write it this way:

        return send_query(fd, family, protocol) &&
               receive_responses(fd, inode);

[...]
> +             for (fi = 0; fi < flen; ++fi) {
> +                     for (pi = 0; pi < plen; ++pi) {
> +                             if (!send_query(fd, families[fi], 
> protocols[pi]))
> +                                     continue;
> +                             if (receive_responses(fd, inode)) {
> +                                     r = true;
> +                                     goto out;
> +                             }
>                       }
>               }

This could be written using your new function inet_print.


-- 
ldv

Attachment: pgpMwsQzotg5q.pgp
Description: PGP signature

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to