[systemd-devel] [PATCH] socket.c: make use of union sockaddr_union

Lennart Poettering lennart at poettering.net
Wed Mar 12 15:38:00 PDT 2014


On Wed, 12.03.14 20:09, Daniel Buch (boogiewasthere at gmail.com) wrote:

Looks good! Applied!

> ---
>  src/core/socket.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/core/socket.c b/src/core/socket.c
> index 35531ed..8ecc9f9 100644
> --- a/src/core/socket.c
> +++ b/src/core/socket.c
> @@ -597,13 +597,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
>  static int instance_from_socket(int fd, unsigned nr, char **instance) {
>          socklen_t l;
>          char *r;
> -        union {
> -                struct sockaddr sa;
> -                struct sockaddr_un un;
> -                struct sockaddr_in in;
> -                struct sockaddr_in6 in6;
> -                struct sockaddr_storage storage;
> -        } local, remote;
> +        union sockaddr_union local, remote;
>  
>          assert(fd >= 0);
>          assert(instance);


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list