Allow Kore to function under DragonflyBSD.

From David Carlier
This commit is contained in:
Joris Vink 2015-06-14 16:54:44 +02:00
parent 9217fb0bd8
commit db198578c6
2 changed files with 10 additions and 3 deletions

View File

@ -40,7 +40,8 @@
#include "kore.h"
#if defined(OpenBSD) || defined(__FreeBSD_version) || defined(NetBSD)
#if defined(OpenBSD) || defined(__FreeBSD_version) || \
defined(NetBSD) || defined(__DragonFly__version)
#define PRI_TIME_T "d"
#endif

View File

@ -229,11 +229,17 @@ kore_server_bind(const char *ip, const char *port)
{
struct listener *l;
int on, r;
struct addrinfo *results;
struct addrinfo hints, *results;
kore_debug("kore_server_bind(%s, %s)", ip, port);
r = getaddrinfo(ip, port, NULL, &results);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = 0;
r = getaddrinfo(ip, port, &hints, &results);
if (r != 0)
fatal("getaddrinfo(%s): %s", ip, gai_strerror(r));