ldb:ldb.c/"ldb_wait" - change "ldb_wait" slightly in order to introduce error messages
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 21 Sep 2011 10:38:46 +0000 (12:38 +0200)
committerAndrew Tridgell <tridge@samba.org>
Tue, 11 Oct 2011 06:42:07 +0000 (08:42 +0200)
In this occasion remove a redundant check for "LDB_ASYNC_DONE":

if (handle->state == LDB_ASYNC_DONE ||    if (handle->state == LDB_ASYNC_DONE)
    handle->status != LDB_SUCCESS) {              return handle->status;
        return handle->status;         == if (handle->status != LDB_SUCCESS)
}                                                 return handle->status;
...                                       ...
return LDB_SUCCESS;                       return LDB_SUCCESS;

Signed-off-by: Andrew Tridgell <tridge@samba.org>
lib/ldb/common/ldb.c

index 0c5f40ae4b593e687765974a7a9bed93f80894e3..d753bf7bd247f6233e4ffe03420e44768b0e37b1 100644 (file)
@@ -596,8 +596,7 @@ int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type)
                if (ret != 0) {
                        return LDB_ERR_OPERATIONS_ERROR;
                }
-               if (handle->state == LDB_ASYNC_DONE ||
-                   handle->status != LDB_SUCCESS) {
+               if (handle->status != LDB_SUCCESS) {
                        return handle->status;
                }
                break;
@@ -612,7 +611,10 @@ int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type)
                                return handle->status;
                        }
                }
-               return handle->status;
+               if (handle->status != LDB_SUCCESS) {
+                       return handle->status;
+               }
+               break;
        }
 
        return LDB_SUCCESS;