From: Руслан Ижбулатов Date: Sat, 25 Feb 2017 12:46:03 +0000 (+0000) Subject: Shuffle some vars around to fix a warning X-Git-Tag: taler-0.2.1~59 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5682fd249949bdbe4d7eeb5431736cf160fcd3a4;p=oweals%2Fgnunet.git Shuffle some vars around to fix a warning On W32 the 'gc' variable is left unused. --- diff --git a/src/util/connection.c b/src/util/connection.c index dfa673a86..e822b264f 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -335,12 +335,17 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb, struct sockaddr_in6 *v6; struct sockaddr *sa; void *uaddr; - struct GNUNET_CONNECTION_Credentials *gcp; - struct GNUNET_CONNECTION_Credentials gc; #ifdef SO_PEERCRED struct ucred uc; socklen_t olen; #endif + struct GNUNET_CONNECTION_Credentials *gcp; +#if HAVE_GETPEEREID || defined(SO_PEERCRED) || HAVE_GETPEERUCRED + struct GNUNET_CONNECTION_Credentials gc; + + gc.uid = 0; + gc.gid = 0; +#endif addrlen = sizeof (addr); sock = @@ -386,8 +391,6 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb, GNUNET_memcpy (uaddr, addr, addrlen); } gcp = NULL; - gc.uid = 0; - gc.gid = 0; if (AF_UNIX == sa->sa_family) { #if HAVE_GETPEEREID