s3-torture: let wait_lock() use cli_lock32() instead of cli_lock()
authorBjörn Baumbach <bb@sernet.de>
Mon, 11 Jul 2011 09:50:59 +0000 (11:50 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 11 Jul 2011 14:35:10 +0000 (16:35 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/torture/torture.c

index 52ae4bb440577303738f300db57b9f2fb676cf3f..41ea8c1ad89132428460dc324323190661ee55a4 100644 (file)
@@ -542,10 +542,20 @@ static bool check_error(int line, struct cli_state *c,
 
 static bool wait_lock(struct cli_state *c, int fnum, uint32 offset, uint32 len)
 {
-       while (!cli_lock(c, fnum, offset, len, -1, WRITE_LOCK)) {
-               if (!check_error(__LINE__, c, ERRDOS, ERRlock, NT_STATUS_LOCK_NOT_GRANTED)) return False;
+       NTSTATUS status;
+
+       status = cli_lock32(c, fnum, offset, len, -1, WRITE_LOCK);
+
+       while (!NT_STATUS_IS_OK(status)) {
+               if (!check_both_error(__LINE__, status, ERRDOS,
+                                     ERRlock, NT_STATUS_LOCK_NOT_GRANTED)) {
+                       return false;
+               }
+
+               status = cli_lock32(c, fnum, offset, len, -1, WRITE_LOCK);
        }
-       return True;
+
+       return true;
 }