s3-libsmb/libsmb_file.c: replace cli_read_old() with cli_read()
authorBjörn Baumbach <bb@sernet.de>
Fri, 22 Jul 2011 12:22:29 +0000 (14:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 23 Jul 2011 07:18:55 +0000 (09:18 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/libsmb/libsmb_file.c

index ebf49252e8971bd40594847b56e7f54d3074e1a1..914b61409d4f25f3d15ddfdf60b6a768199bf13d 100644 (file)
@@ -225,7 +225,7 @@ SMBC_read_ctx(SMBCCTX *context,
               void *buf,
               size_t count)
 {
-       int ret;
+       size_t ret;
        char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
        char *path = NULL;
        char *targetpath = NULL;
@@ -296,9 +296,9 @@ SMBC_read_ctx(SMBCCTX *context,
        }
        /*d_printf(">>>fstat: resolved path as %s\n", targetpath);*/
 
-       ret = cli_read_old(targetcli, file->cli_fd, (char *)buf, offset, count);
-
-       if (ret < 0) {
+       status = cli_read(targetcli, file->cli_fd, (char *)buf, offset,
+                         count, &ret);
+       if (!NT_STATUS_IS_OK(status)) {
                errno = SMBC_errno(context, targetcli);
                TALLOC_FREE(frame);
                return -1;
@@ -306,7 +306,7 @@ SMBC_read_ctx(SMBCCTX *context,
 
        file->offset += ret;
 
-       DEBUG(4, ("  --> %d\n", ret));
+       DEBUG(4, ("  --> %ld\n", (unsigned long)ret));
 
        TALLOC_FREE(frame);
        return ret;  /* Success, ret bytes of data ... */