Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
[nivanova/samba-autobuild/.git] / source3 / torture / locktest2.c
index 68e18439e841a834fbcf96213bcc774f0e743393..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) {
@@ -317,7 +323,7 @@ static void close_files(struct cli_state *cli[NSERVERS][NCONNECTIONS],
                }
        }
        for (server=0;server<NSERVERS;server++) {
-               cli_unlink(cli[server][0], FILENAME);
+               cli_unlink(cli[server][0], FILENAME, aSYSTEM | aHIDDEN);
        }
 }