summaryrefslogtreecommitdiff
path: root/source3/libgpo
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libgpo')
-rw-r--r--source3/libgpo/gpo_filesync.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c
index cdcdcfbf72..ead9261d16 100644
--- a/source3/libgpo/gpo_filesync.c
+++ b/source3/libgpo/gpo_filesync.c
@@ -66,10 +66,14 @@ NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx,
}
while (1) {
+ size_t n = 0;
- int n = cli_read_old(cli, fnum, data, nread, read_size);
+ result = cli_read(cli, fnum, data, nread, read_size, &n);
+ if (!NT_STATUS_IS_OK(result)) {
+ goto out;
+ }
- if (n <= 0)
+ if (n == 0)
break;
if (write(fd, data, n) != n) {