summaryrefslogtreecommitdiff
path: root/debug_syslog.c
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-01-04 10:19:31 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-01-04 10:19:31 +0100
commit10713de6bf9f0c2d9ade248546e63617a9ef9780 (patch)
tree9a796eb5db17ea5f6197c03eb362499d6e1e5b5a /debug_syslog.c
parent26bffbb6a4036a1a1bc3bca99ad9dad66f0618d7 (diff)
parenta325ff7e6f142b7bcb4cc74959ab4e55e9ff0cb9 (diff)
Merge branch 'master' of https://git.oftal.dk/debug
Diffstat (limited to 'debug_syslog.c')
-rw-r--r--debug_syslog.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/debug_syslog.c b/debug_syslog.c
index 2644246..9a2afbd 100644
--- a/debug_syslog.c
+++ b/debug_syslog.c
@@ -33,6 +33,7 @@
#include <sys/socket.h>
#include <arpa/inet.h>
+#include <netdb.h>
#include <unistd.h>
#include <netinet/in.h>
#include <errno.h>
@@ -66,7 +67,9 @@ void dbg_syslog_init(const char* host, int port)
}
memset(&dbg_syslog_sockaddr, 0, sizeof(dbg_syslog_sockaddr));
dbg_syslog_sockaddr.sin_family = AF_INET;
- dbg_syslog_sockaddr.sin_addr.s_addr = inet_addr(host);
+// dbg_syslog_sockaddr.sin_addr.s_addr = inet_addr(host);
+ struct hostent *hp = gethostbyname(host);
+ memcpy(&(dbg_syslog_sockaddr.sin_addr),*(hp->h_addr_list),sizeof(struct in_addr));
dbg_syslog_sockaddr.sin_port = htons(port);
// This implementation has all kind of possible errors: