Skip to contentSkip to conversation

sm-notify needs to call res_init() before each try

PATCH In review Steve Dickson 1 participant 2 messages Oct 12, 2017 – Oct 25, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sm-notify needs to call res_init() before each try

From: Orion Poplawski <[email protected]>

---
 utils/statd/sm-notify.c | 4 ++++
 1 file changed, 4 insertions(+)
utils/statd/sm-notify.c +4 -0
index d216ddb..d961dc0 100644
@@ -28,6 +28,9 @@
 #include <netdb.h>
 #include <errno.h>
 #include <grp.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
 
 #include "conffile.h"
 #include "sockaddr.h"
@@ -90,6 +93,7 @@ smn_lookup(const char *name)
 	};
 	int error;
 
+	res_init();
 	error = getaddrinfo(name, NULL, &hint, &ai);
 	if (error != 0) {
 		xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error));
Signature · 1 line
2.13.6
#1 lore raw
Quoted 5 lines · Steve Dickson

From: Orion Poplawski <[email protected]>

Committed...

steved.

Quoted 27 lines
---
 utils/statd/sm-notify.c | 4 ++++
 1 file changed, 4 insertions(+)
utils/statd/sm-notify.c +4 -0
index d216ddb..d961dc0 100644
@@ -28,6 +28,9 @@
 #include <netdb.h>
 #include <errno.h>
 #include <grp.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
 
 #include "conffile.h"
 #include "sockaddr.h"
@@ -90,6 +93,7 @@ smn_lookup(const char *name)
 	};
 	int error;
 
+	res_init();
 	error = getaddrinfo(name, NULL, &hint, &ai);
 	if (error != 0) {
 		xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error));