diff mbox

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

Message ID 20171012150656.5722-1-steved@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve Dickson Oct. 12, 2017, 3:06 p.m. UTC
From: Orion Poplawski <orion@nwra.com>

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=625531

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/statd/sm-notify.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Steve Dickson Oct. 25, 2017, 7:31 p.m. UTC | #1
On 10/12/2017 11:06 AM, Steve Dickson wrote:
> From: Orion Poplawski <orion@nwra.com>
> 
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=625531
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... 

steved.

> ---
>  utils/statd/sm-notify.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c
> index d216ddb..d961dc0 100644
> --- a/utils/statd/sm-notify.c
> +++ b/utils/statd/sm-notify.c
> @@ -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));
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c
index d216ddb..d961dc0 100644
--- a/utils/statd/sm-notify.c
+++ b/utils/statd/sm-notify.c
@@ -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));