Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int.
[sfrench/samba-autobuild/.git] / source3 / torture / mangle_test.c
index e4468945c18c1a836f24a1e199e2037de8c7fbf0..6ea6c5732c686822e1a24dd636b86bba04d3aeef 100644 (file)
@@ -29,7 +29,7 @@ static unsigned total, collisions, failures;
 
 static bool test_one(struct cli_state *cli, const char *name)
 {
-       int fnum;
+       uint16_t fnum;
        fstring shortname;
        fstring name2;
        NTSTATUS status;
@@ -37,8 +37,7 @@ static bool test_one(struct cli_state *cli, const char *name)
 
        total++;
 
-       fnum = cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
-       if (fnum == -1) {
+       if (!NT_STATUS_IS_OK(cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum))) {
                printf("open of %s failed (%s)\n", name, cli_errstr(cli));
                return False;
        }
@@ -63,8 +62,7 @@ static bool test_one(struct cli_state *cli, const char *name)
        }
 
        /* recreate by short name */
-       fnum = cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
-       if (fnum == -1) {
+       if (!NT_STATUS_IS_OK(cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum))) {
                printf("open2 of %s failed (%s)\n", name2, cli_errstr(cli));
                return False;
        }