Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
[nivanova/samba-autobuild/.git] / source3 / torture / locktest2.c
index 10e2cbe772b8c301e4e231126cbaca3ff742bb21..9cb531450c940aee492bb1720ea50497432dc900 100644 (file)
@@ -68,7 +68,13 @@ static int try_open(struct cli_state *c, char *nfs, int fstype, const char *fnam
 
        switch (fstype) {
        case FSTYPE_SMB:
-               return cli_open(c, fname, flags, DENY_NONE);
+               {
+                       uint16_t fd;
+                       if (!NT_STATUS_IS_OK(cli_open(c, fname, flags, DENY_NONE, &fd))) {
+                               return -1;
+                       }
+                       return fd;
+               }
 
        case FSTYPE_NFS:
                if (asprintf(&path, "%s%s", nfs, fname) > 0) {