summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-11 11:50:59 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-11 16:35:10 +0200
commitb6e9866c54bbcc1d9eaf184b387d863c77adb6e2 (patch)
tree914c98b6cf1f6b3796aa8d2bd0f85905d1e432a1 /source3/torture
parentf2c5a0afd2e219e8d845db08d6d13de65b710f5c (diff)
downloadsamba-b6e9866c54bbcc1d9eaf184b387d863c77adb6e2.tar.gz
samba-b6e9866c54bbcc1d9eaf184b387d863c77adb6e2.tar.bz2
samba-b6e9866c54bbcc1d9eaf184b387d863c77adb6e2.zip
s3-torture: let wait_lock() use cli_lock32() instead of cli_lock()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 52ae4bb440..41ea8c1ad8 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -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;
}