diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2002-12-29 22:28:11 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2002-12-29 22:28:11 +0000 |
commit | 9d89ed33606af4304458a72e2bb76d95624a27e1 (patch) | |
tree | 6407507b839686103e6973eee313dbfd5be94563 /dso | |
parent | 7b37cd40b18f6d5ebb8604b51cd57e191e609b55 (diff) | |
download | libapr-9d89ed33606af4304458a72e2bb76d95624a27e1.tar.gz |
standardize on a couple of easy to test for error codes for DSO errors.
This doesn't work fully on Windows yet, that is the next commit.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso')
-rw-r--r-- | dso/aix/dso.c | 2 | ||||
-rw-r--r-- | dso/beos/dso.c | 6 | ||||
-rw-r--r-- | dso/netware/dso.c | 2 | ||||
-rw-r--r-- | dso/os2/dso.c | 2 | ||||
-rw-r--r-- | dso/unix/dso.c | 10 |
5 files changed, 11 insertions, 11 deletions
diff --git a/dso/aix/dso.c b/dso/aix/dso.c index 1870a42d7..0c0d6be95 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -197,7 +197,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, if (retval == NULL) { handle->errormsg = dlerror(); - return APR_EINIT; + return APR_ESYMNOTFOUND; } *ressym = retval; diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 1cfe6bae1..111c90265 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -74,7 +74,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, image_id newid; if((newid = load_add_on(path)) < B_NO_ERROR) - return APR_EINIT; + return APR_EDSOOPEN; *res_handle = apr_pcalloc(pool, sizeof(*res_handle)); (*res_handle)->handle = newid; @@ -96,13 +96,13 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_hand int err; if (symname == NULL) - return APR_EINIT; + return APR_ESYMNOTFOUND; err = get_image_symbol(handle->handle, symname, B_SYMBOL_TYPE_ANY, ressym); if(err != B_OK) - return APR_EINIT; + return APR_ESYMNOTFOUND; return APR_SUCCESS; } diff --git a/dso/netware/dso.c b/dso/netware/dso.c index 1c562489b..33f960222 100644 --- a/dso/netware/dso.c +++ b/dso/netware/dso.c @@ -141,7 +141,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, if (retval == NULL) { handle->errormsg = dlerror(); - return APR_EINIT; + return APR_ESYMNOTFOUND; } symbol = apr_pcalloc(handle->pool, sizeof(sym_list)); diff --git a/dso/os2/dso.c b/dso/os2/dso.c index d1b79e6c2..c5cb86a67 100644 --- a/dso/os2/dso.c +++ b/dso/os2/dso.c @@ -116,7 +116,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, int rc; if (symname == NULL || ressym == NULL) - return APR_EINIT; + return APR_ESYMNOTFOUND; if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) { handle->load_error = APR_FROM_OS_ERROR(rc); diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 1246d9ddb..dbdd44420 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, if(os_handle == NULL) { #if defined(DSO_USE_SHL) (*res_handle)->errormsg = strerror(errno); - return errno; + return APR_EDSOOPEN; #elif defined(DSO_USE_DYLD) (*res_handle)->errormsg = (err_msg) ? err_msg : "link failed"; return APR_EDSOOPEN; @@ -219,7 +219,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, if (status == -1 && errno == 0) /* try TYPE_DATA instead */ status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_DATA, &symaddr); if (status == -1) - return errno; + return APR_ESYMNOTFOUND; *ressym = symaddr; return APR_SUCCESS; @@ -241,12 +241,12 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, free(symname2); if (symbol == NULL) { handle->errormsg = "undefined symbol"; - return APR_EINIT; + return APR_ESYMNOTFOUND; } retval = NSAddressOfSymbol(symbol); if (retval == NULL) { handle->errormsg = "cannot resolve symbol"; - return APR_EINIT; + return APR_ESYMNOTFOUND; } *ressym = retval; return APR_SUCCESS; @@ -266,7 +266,7 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, if (retval == NULL) { handle->errormsg = dlerror(); - return APR_EINIT; + return APR_ESYMNOTFOUND; } *ressym = retval; |