Skip to content

Commit

Permalink
define sockaddr_un later
Browse files Browse the repository at this point in the history
  • Loading branch information
the-eater committed Sep 18, 2017
1 parent 73f1978 commit 140ec02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/io/syncsocket.c
Expand Up @@ -254,9 +254,6 @@ struct sockaddr * MVM_io_resolve_host_name(MVMThreadContext *tc, MVMString *host
int error;
int flags = 0;
struct addrinfo *result;
#ifndef _WIN32
struct sockaddr_un *result_un = MVM_malloc(sizeof(struct sockaddr_un));
#endif
char port_cstr[8];

if (port > 65535) {
Expand All @@ -265,6 +262,8 @@ struct sockaddr * MVM_io_resolve_host_name(MVMThreadContext *tc, MVMString *host

#ifndef _WIN32
if (flags & AF_UNIX) {
struct sockaddr_un *result_un = MVM_malloc(sizeof(struct sockaddr_un));

if (strlen(host_cstr) > 108) {
MVM_exception_throw_adhoc(tc, "Socket path can only be maximal 107 characters long");
}
Expand Down

0 comments on commit 140ec02

Please sign in to comment.