From eb3a54c3da3e1aed9c229b70049bf04531337e8e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 17 Nov 2011 17:57:12 +0100 Subject: [PATCH] DEBUG cancel --- source3/torture/torture.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index ae502f280fee..2e675ae01078 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -3886,7 +3886,7 @@ static bool run_oplock4(int dummy) state->cli = cli1; state->got_break = &got_break; state->fnum2 = &fnum2; - +/* oplock_req = cli_smb_oplock_break_waiter_send( talloc_tos(), ev, cli1); if (oplock_req == NULL) { @@ -3894,7 +3894,7 @@ static bool run_oplock4(int dummy) return false; } tevent_req_set_callback(oplock_req, oplock4_got_break, state); - +*/ open_req = cli_openx_send( talloc_tos(), ev, cli2, fname_ln, O_RDWR, DENY_NONE); if (open_req == NULL) { @@ -3902,11 +3902,12 @@ static bool run_oplock4(int dummy) return false; } tevent_req_set_callback(open_req, oplock4_got_open, state); + tevent_req_cancel(open_req); got_break = false; fnum2 = 0xffff; - while (!got_break || fnum2 == 0xffff) { + while (tevent_req_is_in_progress(open_req)) {// !got_break || fnum2 == 0xffff) { int ret; ret = tevent_loop_once(ev); if (ret == -1) { @@ -3928,6 +3929,18 @@ static bool run_oplock4(int dummy) correct = false; } + status = cli_open(cli2, fname, O_RDWR, DENY_NONE, &fnum2); + if (!NT_STATUS_IS_OK(status)) { + printf("open of %s failed (%s)\n", fname, nt_errstr(status)); + return false; + } + + status = cli_close(cli2, fnum2); + if (!NT_STATUS_IS_OK(status)) { + printf("close2 failed (%s)\n", nt_errstr(status)); + correct = false; + } + status = cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); if (!NT_STATUS_IS_OK(status)) { printf("unlink failed (%s)\n", nt_errstr(status)); -- 2.34.1