Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
[sfrench/samba-autobuild/.git] / source3 / libgpo / gpo_filesync.c
index 6d64d7b968ce766b4fbde810d42925db6341cdb5..d4b623ad6e13dd0735d3941fa0cc3ed82184d4ed 100644 (file)
@@ -39,15 +39,15 @@ NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx,
                       const char *unix_path)
 {
        NTSTATUS result;
-       int fnum;
+       uint16_t fnum;
        int fd = 0;
        char *data = NULL;
        static int io_bufsize = 64512;
        int read_size = io_bufsize;
        off_t nread = 0;
 
-       if ((fnum = cli_open(cli, nt_path, O_RDONLY, DENY_NONE)) == -1) {
-               result = NT_STATUS_NO_SUCH_FILE;
+       result = cli_open(cli, nt_path, O_RDONLY, DENY_NONE, &fnum);
+       if (!NT_STATUS_IS_OK(result)) {
                goto out;
        }