[systemd-devel] [PATCH] test-resolve.c: cleanup alittle bit and make use of sockaddr_pretty()

Lennart Poettering lennart at poettering.net
Mon Mar 24 18:00:52 PDT 2014


On Fri, 14.03.14 23:53, Daniel Buch (boogiewasthere at gmail.com) wrote:

> +        struct sockaddr_in sa = {
> +                .sin_family = AF_INET,
> +                .sin_addr.s_addr = inet_addr(argc >= 3 ? argv[2] : "193.99.144.71"),
> +                .sin_port = htons(80)
> +        };

I'd prefer not to invoke functions within variable
declarations. htons() is OK, since glibc actually defines this as a
macro that is resolved at compile time, but please do inet_addr() in
later code.

Otherwise looks great!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list