summaryrefslogtreecommitdiffstats
path: root/source3/torture/torture.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-05-20 18:31:36 -0700
committerJeremy Allison <jra@samba.org>2009-05-20 18:31:36 -0700
commit000da55dd930d151db14ee8eed58e82806522692 (patch)
treed04850e454a6f01749ad60d767927e6afaf64fff /source3/torture/torture.c
parentc1a21d085d758284fe6997a05396f225da683352 (diff)
downloadsamba-000da55dd930d151db14ee8eed58e82806522692.tar.gz
samba-000da55dd930d151db14ee8eed58e82806522692.tar.xz
samba-000da55dd930d151db14ee8eed58e82806522692.zip
Make cli_posix_open() and cli_posix_mkdir() async.
Jeremy.
Diffstat (limited to 'source3/torture/torture.c')
-rw-r--r--source3/torture/torture.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 162ba2bc823..25a912dec5f 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4139,7 +4139,7 @@ static bool run_simple_posix_open_test(int dummy)
const char *dname = "\\posix:dir";
uint16 major, minor;
uint32 caplow, caphigh;
- int fnum1 = -1;
+ uint16_t fnum1 = (uint16_t)-1;
bool correct = false;
printf("Starting simple POSIX open test\n");
@@ -4173,13 +4173,12 @@ static bool run_simple_posix_open_test(int dummy)
cli_posix_rmdir(cli1, dname);
/* Create a directory. */
- if (cli_posix_mkdir(cli1, dname, 0777) == -1) {
+ if (!NT_STATUS_IS_OK(cli_posix_mkdir(cli1, dname, 0777))) {
printf("POSIX mkdir of %s failed (%s)\n", dname, cli_errstr(cli1));
goto out;
}
- fnum1 = cli_posix_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, 0600);
- if (fnum1 == -1) {
+ if (!NT_STATUS_IS_OK(cli_posix_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, 0600, &fnum1))) {
printf("POSIX create of %s failed (%s)\n", fname, cli_errstr(cli1));
goto out;
}
@@ -4190,8 +4189,7 @@ static bool run_simple_posix_open_test(int dummy)
}
/* Now open the file again for read only. */
- fnum1 = cli_posix_open(cli1, fname, O_RDONLY, 0);
- if (fnum1 == -1) {
+ if (!NT_STATUS_IS_OK(cli_posix_open(cli1, fname, O_RDONLY, 0, &fnum1))) {
printf("POSIX open of %s failed (%s)\n", fname, cli_errstr(cli1));
goto out;
}
@@ -4208,8 +4206,7 @@ static bool run_simple_posix_open_test(int dummy)
}
/* Ensure the file has gone. */
- fnum1 = cli_posix_open(cli1, fname, O_RDONLY, 0);
- if (fnum1 != -1) {
+ if (NT_STATUS_IS_OK(cli_posix_open(cli1, fname, O_RDONLY, 0, &fnum1))) {
printf("POSIX open of %s succeeded, should have been deleted.\n", fname);
goto out;
}