summaryrefslogtreecommitdiff
path: root/src/nss-myhostname
diff options
context:
space:
mode:
Diffstat (limited to 'src/nss-myhostname')
-rw-r--r--src/nss-myhostname/nss-myhostname.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index bf1e311137..08d70f6c0d 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -165,6 +165,11 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
if (ttlp)
*ttlp = 0;
+ /* Explicitly reset all error variables */
+ *errnop = 0;
+ *h_errnop = NETDB_SUCCESS;
+ h_errno = 0;
+
return NSS_STATUS_SUCCESS;
}
@@ -289,6 +294,11 @@ static enum nss_status fill_in_hostent(
if (canonp)
*canonp = r_name;
+ /* Explicitly reset all error variables */
+ *errnop = 0;
+ *h_errnop = NETDB_SUCCESS;
+ h_errno = 0;
+
return NSS_STATUS_SUCCESS;
}