From b6e9866c54bbcc1d9eaf184b387d863c77adb6e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Baumbach?= Date: Mon, 11 Jul 2011 11:50:59 +0200 Subject: [PATCH] s3-torture: let wait_lock() use cli_lock32() instead of cli_lock() Signed-off-by: Stefan Metzmacher --- source3/torture/torture.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 52ae4bb4405..41ea8c1ad89 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; } -- 2.11.4.GIT