s3-torture: rw_torture(): replace cli_read_old() with cli_read()
authorBjörn Baumbach <bb@sernet.de>
Tue, 19 Jul 2011 13:29:14 +0000 (15:29 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Jul 2011 20:09:26 +0000 (22:09 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/torture/torture.c

index 42dd7e4e027a9db123a450a872f7e48425bd44b2..8757904cd3c7b9c9901af480f1a8fe8934f1a9e0 100644 (file)
@@ -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) {