diff options
author | Max Kellermann <max@duempel.org> | 2009-03-01 01:49:49 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-01 01:49:49 +0100 |
commit | c0e61687b60583dc75bb5a0acd718772a6984844 (patch) | |
tree | f473e8c4ea243c015be6005a309d04da6ea7b88a /src | |
parent | 8c3df4cc83b72dfca20cbf82d4155a1025785dcc (diff) | |
download | mpd-c0e61687b60583dc75bb5a0acd718772a6984844.tar.gz mpd-c0e61687b60583dc75bb5a0acd718772a6984844.tar.xz mpd-c0e61687b60583dc75bb5a0acd718772a6984844.zip |
listen: fix windows specific code
During the listen_add_host() API transition, the windows code wasn't
tested, and several removed arguments are still in use there.
Diffstat (limited to 'src')
-rw-r--r-- | src/listen.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/listen.c b/src/listen.c index ff4d5cccd..aca11b571 100644 --- a/src/listen.c +++ b/src/listen.c @@ -295,18 +295,21 @@ listen_add_host(const char *hostname, unsigned port, GError **error) #else /* WIN32 */ const struct hostent *he; - g_debug("binding to address for %s", param->value); + g_debug("binding to address for %s", hostname); - he = gethostbyname(param->value); + he = gethostbyname(hostname); if (he == NULL) { g_set_error(error, listen_quark(), 0, "Failed to look up host \"%s\"", hostname); return false; } - if (he->h_addrtype != AF_INET) - g_error("IPv4 address expected for host \"%s\" at line %i", - param->value, param->line); + if (he->h_addrtype != AF_INET) { + g_set_error(error, listen_quark(), 0, + "IPv4 address expected for host \"%s\"", + hostname); + return false; + } return listen_add_address(AF_INET, he->h_addr, he->h_length, error); |