diff options
author | Björn Baumbach <bb@sernet.de> | 2011-07-19 15:29:14 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-20 22:09:26 +0200 |
commit | b10fa4bbcd49b313154ab59309d046aa35dd9ef7 (patch) | |
tree | 9c024c7afb6c16364a2626a57607989612a13514 /source3/torture | |
parent | 8c360d7f76c7c054781ac41c4d823d0529af1577 (diff) | |
download | samba-b10fa4bbcd49b313154ab59309d046aa35dd9ef7.tar.gz samba-b10fa4bbcd49b313154ab59309d046aa35dd9ef7.tar.bz2 samba-b10fa4bbcd49b313154ab59309d046aa35dd9ef7.zip |
s3-torture: rw_torture(): replace cli_read_old() with cli_read()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/torture.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 42dd7e4e02..8757904cd3 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -569,6 +569,7 @@ static bool rw_torture(struct cli_state *c) int i, j; char buf[1024]; bool correct = True; + size_t nread = 0; NTSTATUS status; memset(buf, '\0', sizeof(buf)); @@ -624,9 +625,16 @@ static bool rw_torture(struct cli_state *c) pid2 = 0; - if (cli_read_old(c, fnum, (char *)&pid2, 0, sizeof(pid)) != sizeof(pid)) { - printf("read failed (%s)\n", cli_errstr(c)); - correct = False; + status = cli_read(c, fnum, (char *)&pid2, 0, sizeof(pid), + &nread); + if (!NT_STATUS_IS_OK(status)) { + printf("read failed (%s)\n", nt_errstr(status)); + correct = false; + } else if (nread != sizeof(pid)) { + printf("read/write compare failed: " + "recv %ld req %ld\n", (unsigned long)nread, + (unsigned long)sizeof(pid)); + correct = false; } if (pid2 != pid) { |