Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
[nivanova/samba-autobuild/.git] / source3 / torture / masktest.c
index fb562c80755d396cb9d51ed5eff2da21dbf6d90b..768323b9f73d27a0cc3eb6bbb7f1a40398c2687a 100644 (file)
@@ -311,7 +311,7 @@ static void get_real_name(struct cli_state *cli,
 
 static void testpair(struct cli_state *cli, const char *mask, const char *file)
 {
-       int fnum;
+       uint16_t fnum;
        fstring res1;
        char *res2;
        static int count;
@@ -322,8 +322,7 @@ static void testpair(struct cli_state *cli, const char *mask, const char *file)
 
        fstrcpy(res1, "---");
 
-       fnum = cli_open(cli, file, O_CREAT|O_TRUNC|O_RDWR, 0);
-       if (fnum == -1) {
+       if (!NT_STATUS_IS_OK(cli_open(cli, file, O_CREAT|O_TRUNC|O_RDWR, 0, &fnum))) {
                DEBUG(0,("Can't create %s\n", file));
                return;
        }
@@ -350,7 +349,7 @@ static void testpair(struct cli_state *cli, const char *mask, const char *file)
                if (die_on_error) exit(1);
        }
 
-       cli_unlink(cli, file);
+       cli_unlink(cli, file, aSYSTEM | aHIDDEN);
 
        if (count % 100 == 0) DEBUG(0,("%d\n", count));
        SAFE_FREE(long_name);
@@ -367,7 +366,7 @@ static void test_mask(int argc, char *argv[],
 
        cli_mkdir(cli, "\\masktest");
 
-       cli_unlink(cli, "\\masktest\\*");
+       cli_unlink(cli, "\\masktest\\*", aSYSTEM | aHIDDEN);
 
        if (argc >= 2) {
                while (argc >= 2) {