-/* $Id: pazpar2.c,v 1.23 2007-01-10 10:04:23 adam Exp $ */;
+/* $Id: pazpar2.c,v 1.26 2007-01-10 11:56:10 adam Exp $ */
#include <stdlib.h>
#include <stdio.h>
#include <yaz/timing.h>
#endif
+#include <netinet/in.h>
+
#include "pazpar2.h"
#include "eventl.h"
#include "http.h"
if (!(addr = cs_straddr(link, cl->database->host->ipport)))
{
- yaz_log(YLOG_WARN|YLOG_ERRNO, "Lookup of IP address failed?");
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Lookup of IP address %s failed?",
+ cl->database->host->ipport);
return 0;
}
}
assert(addrinfo->ai_family == PF_INET);
memcpy(addrbuf, &((struct sockaddr_in*)addrinfo->ai_addr)->sin_addr.s_addr, 4);
- sprintf(ipport, "%hhd.%hhd.%hhd.%hhd:%s",
+ sprintf(ipport, "%u.%u.%u.%u:%s",
addrbuf[0], addrbuf[1], addrbuf[2], addrbuf[3], port);
host->ipport = xstrdup(ipport);
freeaddrinfo(addrinfo);
char *arg;
int setport = 0;
- if (signal(SIGPIPE, SIG_IGN) < 0)
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
yaz_log(YLOG_WARN|YLOG_ERRNO, "signal");
yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);