summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-22 14:01:12 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-23 09:18:55 +0200
commit473b16dcbf31f385905738be56f5cba86c14cb01 (patch)
treeeb7f58c72d405645e33cf08a1a17bec92e7f0e3f
parent78333531ded3e2ec85d4478b8a194561687fddc8 (diff)
downloadsamba-473b16dcbf31f385905738be56f5cba86c14cb01.tar.gz
samba-473b16dcbf31f385905738be56f5cba86c14cb01.tar.bz2
samba-473b16dcbf31f385905738be56f5cba86c14cb01.zip
s3-torture/nbio.c: replace cli_read_old() with cli_read()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/torture/nbio.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index e6caf7476b..4cf4cc7549 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -212,12 +212,23 @@ void nb_writex(int handle, int offset, int size, int ret_size)
void nb_readx(int handle, int offset, int size, int ret_size)
{
- int i, ret;
+ int i;
+ NTSTATUS status;
+ size_t nread;
i = find_handle(handle);
- if ((ret=cli_read_old(c, ftable[i].fd, buf, offset, size)) != ret_size) {
- printf("(%d) ERROR: read failed on handle %d ofs=%d size=%d res=%d fd %d errno %d (%s)\n",
- line_count, handle, offset, size, ret, ftable[i].fd, errno, strerror(errno));
+ status = cli_read(c, ftable[i].fd, buf, offset, size, &nread);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("(%d) ERROR: read failed on handle %d ofs=%d size=%d "
+ "fd %d nterror %s\n",
+ line_count, handle, offset, size,
+ ftable[i].fd, nt_errstr(status));
+ exit(1);
+ } else if (nread != ret_size) {
+ printf("(%d) ERROR: read failed on handle %d ofs=%d size=%d "
+ "nread=%lu ret_size=%d fd %d\n",
+ line_count, handle, offset, size, (unsigned long)nread,
+ ret_size, ftable[i].fd);
exit(1);
}
children[nbio_id].bytes_in += ret_size;