apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r562718 - /apr/apr-util/trunk/dbm/apr_dbm_sdbm.c
Date Sat, 04 Aug 2007 13:34:47 GMT
Author: davi
Date: Sat Aug  4 06:34:47 2007
New Revision: 562718

URL: http://svn.apache.org/viewvc?view=rev&rev=562718
Log:
The SDBM functions returns APR error codes.

Modified:
    apr/apr-util/trunk/dbm/apr_dbm_sdbm.c

Modified: apr/apr-util/trunk/dbm/apr_dbm_sdbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm_sdbm.c?view=diff&rev=562718&r1=562717&r2=562718
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm_sdbm.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm_sdbm.c Sat Aug  4 06:34:47 2007
@@ -34,19 +34,15 @@
 
 static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said)
 {
-    apr_status_t rv = APR_SUCCESS;
+    dbm->errcode = dbm_said;
 
-    /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */
-
-    if ((dbm->errcode = dbm_said) == APR_SUCCESS) {
+    if (dbm_said != APR_SUCCESS) {
+        dbm->errmsg = apr_psprintf(dbm->pool, "%pm", &dbm_said);
+    } else {
         dbm->errmsg = NULL;
     }
-    else {
-        dbm->errmsg = "I/O error occurred.";
-        rv = APR_EGENERAL;        /* ### need something better */
-    }
 
-    return rv;
+    return dbm_said;
 }
 
 /* --------------------------------------------------------------------------



Mime
View raw message