diff options
author | Björn Baumbach <bb@sernet.de> | 2011-07-19 16:01:42 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-20 22:09:26 +0200 |
commit | c53e2ad4de17a7f7ddaa80d79dfe99e3578c2ab7 (patch) | |
tree | e0d00dca6a3787f0da36d314d8576a69c9562062 | |
parent | ea4c4480b483a90d194dfded586cba1917b8825d (diff) | |
download | samba-c53e2ad4de17a7f7ddaa80d79dfe99e3578c2ab7.tar.gz samba-c53e2ad4de17a7f7ddaa80d79dfe99e3578c2ab7.tar.bz2 samba-c53e2ad4de17a7f7ddaa80d79dfe99e3578c2ab7.zip |
s3-torture: rw_torture2(): replace cli_read_old() with cli_read()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/torture/torture.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index b17171138f..83873675c8 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -808,7 +808,7 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2) char buf[131072]; char buf_rd[131072]; bool correct = True; - ssize_t bytes_read; + size_t bytes_read; NTSTATUS status; status = cli_unlink(c1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); @@ -849,9 +849,15 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2) break; } - if ((bytes_read = cli_read_old(c2, fnum2, buf_rd, 0, buf_size)) != buf_size) { - printf("read failed (%s)\n", cli_errstr(c2)); - printf("read %d, expected %ld\n", (int)bytes_read, + status = cli_read(c2, fnum2, buf_rd, 0, buf_size, &bytes_read); + if(!NT_STATUS_IS_OK(status)) { + printf("read failed (%s)\n", nt_errstr(status)); + correct = false; + break; + } else if (bytes_read != buf_size) { + printf("read failed\n"); + printf("read %ld, expected %ld\n", + (unsigned long)bytes_read, (unsigned long)buf_size); correct = False; break; |