]> git.sur5r.net Git - openldap/commitdiff
More errno handling changes for FreeBSD LinuxThreads.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 8 Apr 1999 04:17:32 +0000 (04:17 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 8 Apr 1999 04:17:32 +0000 (04:17 +0000)
servers/slapd/back-bdb2/porter.c
servers/slapd/back-bdb2/txn.c
servers/slapd/back-ldbm/dbcache.c

index 39d3809d361981d5e5092bdff5b647f4694f7216..26e36107730912ae4a10bae3266ddbfe3005505d 100644 (file)
@@ -61,11 +61,11 @@ bdb2i_enter_backend_rw( DB_LOCK *lock, int writer )
                                                writer ? "write" : "read", 0, 0 );
                                        break;
 
-                               default:
+                               default: 
+                                       ret = errno;
                                        Debug( LDAP_DEBUG_ANY,
                                                "bdb2i_enter_backend() -- %s lock returned ERROR: %s\n",
-                                               writer ? "write" : "read", strerror( errno ), 0 );
-                                       ret = errno;
+                                               writer ? "write" : "read", strerror( ret ), 0 );
                                        break;
 
                        }
@@ -130,10 +130,10 @@ bdb2i_leave_backend_rw( DB_LOCK lock, int writer )
                                        break;
 
                                default:
+                                       ret_lock = errno;
                                        Debug( LDAP_DEBUG_ANY,
                                                "bdb2i_leave_backend() -- %s lock returned ERROR: %s\n",
-                                               writer ? "write" : "read", strerror( errno ), 0 );
-                                       ret_lock = errno;
+                                               writer ? "write" : "read", strerror( ret_lock ), 0 );
                                        break;
                        
                        }
index 5b53850595dee5d0a1d51074ddc41f37587ab9de..7010a3a11ad114f57710cd21dd08f0812e0d3a4a 100644 (file)
@@ -316,10 +316,11 @@ bdb2i_check_additional_attr_index( struct ldbminfo *li )
        struct dirent  *file;
 
        if ( ( datadir = opendir( li->li_directory ) ) == NULL ) {
+               int err = errno;
 
                Debug( LDAP_DEBUG_ANY,
        "bdb2i_check_additional_attr_index(): ERROR while opening datadir: %s\n",
-                               strerror( errno ), 0, 0 );
+                               strerror( err ), 0, 0 );
                return( 1 );
 
        }
@@ -689,8 +690,9 @@ bdb2i_start_transction( DB_TXNMGR *txmgr )
        txn_do_abort = 0;
 
        if (( rc = txn_begin( txmgr, NULL, &txnid )) != 0 ) {
+               int err = errno;
                Debug( LDAP_DEBUG_ANY, "bdb2i_start_transction failed: %d: errno=%s\n",
-                                       rc, strerror( errno ), 0 );
+                                       rc, strerror( err ), 0 );
 
                if ( txnid != NULL )
                        (void) txn_abort( txnid );
index b068612fe3d57359ef68cc90c6836dee78409eae..3da8ed422649322b2c875edc12ec2497c20f6074 100644 (file)
@@ -92,10 +92,11 @@ ldbm_cache_open(
 
        if ( (li->li_dbcache[i].dbc_db = ldbm_open( buf, flags, li->li_mode,
            li->li_dbcachesize )) == NULL ) {
+               int err = errno;
                Debug( LDAP_DEBUG_TRACE,
                    "<= ldbm_cache_open NULL \"%s\" errno %d reason \"%s\")\n",
-                   buf, errno, errno > -1 && errno < sys_nerr ?
-                   sys_errlist[errno] : "unknown" );
+                   buf, err, err > -1 && err < sys_nerr ?
+                   sys_errlist[err] : "unknown" );
                ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
                return( NULL );
        }