about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-14 10:26:17 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-14 10:26:17 +0000
commitcfe689f85b0b39d1f3b3e21d9b564d34b2146d88 (patch)
tree38278b3d5d30131f18530213e17f442cb7b08e89
parentf8b30b2846c25461940c99d8fd4432ec49920098 (diff)
downloadcmogstored-cfe689f85b0b39d1f3b3e21d9b564d34b2146d88.tar.gz
A typo caused unnecessary DNS lookups when inheriting sockets.
While we're at it, fix another typo in the error message, too.
-rw-r--r--inherit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/inherit.c b/inherit.c
index 588ead1..03bc780 100644
--- a/inherit.c
+++ b/inherit.c
@@ -36,7 +36,7 @@ static void register_listen_fd(int fd)
 {
         struct listener tmp;
         struct listener *ins;
-        int flags = NI_NUMERICSERV | NI_NUMERICSERV;
+        int flags = NI_NUMERICHOST | NI_NUMERICSERV;
         char hbuf[MOG_NI_MAXHOST];
         char sbuf[MOG_NI_MAXSERV];
         int rc;
@@ -48,7 +48,7 @@ static void register_listen_fd(int fd)
         rc = getnameinfo(&tmp.as.sa, tmp.len,
                          hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), flags);
         if (rc != 0)
-                die("getaddrinfo failed: %s", gai_strerror(rc));
+                die("getnameinfo failed: %s", gai_strerror(rc));
 
         syslog(LOG_INFO, "inherited %s:%s on fd=%d", hbuf, sbuf, fd);