rwrap: Explicitly zero out sin_zero to silence gcc warnings.
authorJakub Hrozek <jakub.hrozek@gmail.com>
Tue, 21 Oct 2014 13:34:28 +0000 (15:34 +0200)
committerAndreas Schneider <asn@samba.org>
Thu, 23 Oct 2014 12:13:29 +0000 (14:13 +0200)
On some platforms, failure to set the sin_zero structure lead to
warnings such as:

resolv_wrapper.c:969:5: warning: missing initializer for field ‘sin_zero’
        of ‘struct sockaddr_in’ [-Wmissing-field-initializers]

     };
     ^
In file included from /usr/include/arpa/inet.h:22:0,
                 from /.../source/src/resolv_wrapper.c:38:

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
src/resolv_wrapper.c

index 7245ef689b7c9869243fb257ad932e61e7a57c1d..d4b16fa828160b2d0a6b52180680acfb459a0bd9 100644 (file)
@@ -970,6 +970,7 @@ static int rwrap_parse_resolv_conf(struct __res_state *state,
                                        .sin_family = AF_INET,
                                        .sin_addr = a,
                                        .sin_port = htons(53),
+                                       .sin_zero = { 0 },
                                };
 
                                state->nscount++;