summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjlib/include/pj/errno.h5
-rw-r--r--pjlib/src/pj/addr_resolv_sock.c2
-rw-r--r--pjlib/src/pj/errno.c1
3 files changed, 7 insertions, 1 deletions
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index 8b5906cb..5744a754 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -285,6 +285,11 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
* Size is too big.
*/
#define PJ_ETOOBIG (PJ_ERRNO_START_STATUS + 17)/* 70017 */
+/**
+ * @hideinitializer
+ * Error in gethostbyname()
+ */
+#define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)/* 70018 */
/** @} */ /* pj_errnum */
diff --git a/pjlib/src/pj/addr_resolv_sock.c b/pjlib/src/pj/addr_resolv_sock.c
index 36c1c574..af3d40c3 100644
--- a/pjlib/src/pj/addr_resolv_sock.c
+++ b/pjlib/src/pj/addr_resolv_sock.c
@@ -38,7 +38,7 @@ PJ_DEF(pj_status_t) pj_gethostbyname(const pj_str_t *hostname, pj_hostent *phe)
he = gethostbyname(copy);
if (!he)
- return PJ_RETURN_OS_ERROR(pj_get_native_netos_error());
+ return PJ_ERESOLVE;
phe->h_name = he->h_name;
phe->h_aliases = he->h_aliases;
diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c
index da06f996..b3a9b329 100644
--- a/pjlib/src/pj/errno.c
+++ b/pjlib/src/pj/errno.c
@@ -64,6 +64,7 @@ static const struct
PJ_BUILD_ERR(PJ_EEXISTS, "Object already exists" ),
PJ_BUILD_ERR(PJ_EEOF, "End of file" ),
PJ_BUILD_ERR(PJ_ETOOBIG, "Size is too big"),
+ PJ_BUILD_ERR(PJ_ERESOLVE, "gethostbyname() has returned error"),
};
#endif /* PJ_HAS_ERROR_STRING */