summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/network.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/network.c b/src/core/network.c
index 61ba909b..ebf3de1f 100644
--- a/src/core/network.c
+++ b/src/core/network.c
@@ -255,7 +255,7 @@ GIOChannel *net_accept(GIOChannel *handle, IPADDR *addr, int *port)
g_return_val_if_fail(handle != NULL, NULL);
- addrlen = SIZEOF_SOCKADDR(so);
+ addrlen = sizeof(so);
ret = accept(g_io_channel_unix_get_fd(handle), &so.sa, &addrlen);
if (ret < 0)
@@ -308,14 +308,14 @@ int net_transmit(GIOChannel *handle, const char *data, int len)
int net_getsockname(GIOChannel *handle, IPADDR *addr, int *port)
{
union sockaddr_union so;
- socklen_t len;
+ socklen_t addrlen;
g_return_val_if_fail(handle != NULL, -1);
g_return_val_if_fail(addr != NULL, -1);
- len = SIZEOF_SOCKADDR(so);
+ addrlen = sizeof(so);
if (getsockname(g_io_channel_unix_get_fd(handle),
- (struct sockaddr *) &so, &len) == -1)
+ (struct sockaddr *) &so, &addrlen) == -1)
return -1;
sin_get_ip(&so, addr);