diff options
author | Björn Baumbach <bb@sernet.de> | 2011-07-19 15:49:03 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-20 22:09:26 +0200 |
commit | ea4c4480b483a90d194dfded586cba1917b8825d (patch) | |
tree | 80d06347135ad638b5045cb5e2a7de5eb7556db6 /source3 | |
parent | b10fa4bbcd49b313154ab59309d046aa35dd9ef7 (diff) | |
download | samba-ea4c4480b483a90d194dfded586cba1917b8825d.tar.gz samba-ea4c4480b483a90d194dfded586cba1917b8825d.tar.bz2 samba-ea4c4480b483a90d194dfded586cba1917b8825d.zip |
s3-torture: rw_torture3(): replace cli_read_old() with cli_read()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/torture/torture.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 8757904cd3..b17171138f 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -695,7 +695,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname) char buf_rd[131072]; unsigned count; unsigned countprev = 0; - ssize_t sent = 0; + size_t sent = 0; bool correct = True; NTSTATUS status = NT_STATUS_OK; @@ -760,7 +760,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname) } status = cli_writeall(c, fnum, 0, (uint8_t *)buf+count, - count, (size_t)sent, NULL); + count, sent, NULL); if (!NT_STATUS_IS_OK(status)) { printf("write failed (%s)\n", nt_errstr(status)); @@ -769,18 +769,15 @@ static bool rw_torture3(struct cli_state *c, char *lockfname) } else { - sent = cli_read_old(c, fnum, buf_rd+count, count, - sizeof(buf)-count); - if (sent < 0) - { + status = cli_read(c, fnum, buf_rd+count, count, + sizeof(buf)-count, &sent); + if(!NT_STATUS_IS_OK(status)) { printf("read failed offset:%d size:%ld (%s)\n", count, (unsigned long)sizeof(buf)-count, - cli_errstr(c)); + nt_errstr(status)); correct = False; sent = 0; - } - if (sent > 0) - { + } else if (sent > 0) { if (memcmp(buf_rd+count, buf+count, sent) != 0) { printf("read/write compare failed\n"); |