aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAndreas Fuchs <andreas.fuchs@sit.fraunhofer.de>2018-03-29 16:58:07 +0200
committerTadeusz Struk <tadeusz.struk@intel.com>2018-03-29 15:53:42 -0700
commit1c4a8118b8affed6d0ef9ec5e307e2c5877ed3bf (patch)
tree1ef743583c7a76882459fff64dacf9880e261ecb /src/util
parentac2b4dcb9e377ad316cd6a0ab72ee78377030063 (diff)
downloadtpm2-tss-1c4a8118b8affed6d0ef9ec5e307e2c5877ed3bf.tar.gz
Build: Fixes for Wmissing-field-initializers
Fixes for all module against missing-field-initializers errors. Actually, many of those were not even needed or used. Kept the warning suppressed for the tests for the moment. It's debatable, if we want to keep it for tests forever though. Also had to define CFLAGS for libtestutil. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/io.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/util/io.c b/src/util/io.c
index ce6965b6..1d33db03 100644
--- a/src/util/io.c
+++ b/src/util/io.c
@@ -146,7 +146,6 @@ socket_connect (
uint16_t port,
SOCKET *sock)
{
- struct sockaddr_in sockaddr = { 0 };
int ret = 0;
if (hostname == NULL || sock == NULL) {
@@ -160,9 +159,11 @@ socket_connect (
errno, strerror (errno));
return TSS2_TCTI_RC_IO_ERROR;
}
- sockaddr.sin_family = AF_INET;
- sockaddr.sin_addr.s_addr = inet_addr (hostname);
- sockaddr.sin_port = htons (port);
+ struct sockaddr_in sockaddr = {
+ .sin_family = AF_INET,
+ .sin_addr.s_addr = inet_addr (hostname),
+ .sin_port = htons (port),
+ .sin_zero = { 0, } };
LOG_DEBUG ("Connecting socket %d to hostname %s on port %" PRIu16,
*sock, hostname, port);