From ea4c4480b483a90d194dfded586cba1917b8825d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Baumbach?= Date: Tue, 19 Jul 2011 15:49:03 +0200 Subject: [PATCH] s3-torture: rw_torture3(): replace cli_read_old() with cli_read() Signed-off-by: Stefan Metzmacher --- source3/torture/torture.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 8757904cd3c..b17171138fb 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"); -- 2.11.4.GIT