diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-09-14 21:16:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-09-14 21:16:11 +0000 |
commit | 17c7fd2117291732b0ffec394658028578233c1a (patch) | |
tree | b4ce0c14308f5bc15f938ce3b5425e5a8c0e399d /pjlib/src | |
parent | b6b613a4e59e2177a2e899dc4e21ab660c05de3d (diff) |
Applied temporary fix to error code returned by pj_gethostbyname(). Under *nix, the error code is returned in h_errno, and the error string is reported by hstrerror(). But it is a bit too complex to support this for the moment, so we just return PJ_ERESOLVE for any failure returned by gethostbyname()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@722 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src')
-rw-r--r-- | pjlib/src/pj/addr_resolv_sock.c | 2 | ||||
-rw-r--r-- | pjlib/src/pj/errno.c | 1 |
2 files changed, 2 insertions, 1 deletions
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 */ |