summaryrefslogtreecommitdiff
path: root/source3/torture/denytest.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/torture/denytest.c')
-rw-r--r--source3/torture/denytest.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c
index 3a7906fb33..017bb1c06d 100644
--- a/source3/torture/denytest.c
+++ b/source3/torture/denytest.c
@@ -1408,7 +1408,7 @@ static void progress_bar(unsigned i, unsigned total)
*/
BOOL torture_denytest1(int dummy)
{
- struct cli_state *cli1;
+ static struct cli_state cli1;
int fnum1, fnum2;
int i;
BOOL correct = True;
@@ -1421,10 +1421,10 @@ BOOL torture_denytest1(int dummy)
printf("starting denytest1\n");
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i]);
- fnum1 = cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
- cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
- cli_close(cli1, fnum1);
+ cli_unlink(&cli1, fnames[i]);
+ fnum1 = cli_open(&cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
+ cli_write(&cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
+ cli_close(&cli1, fnum1);
}
printf("testing %d entries\n", ARRAY_SIZE(denytable1));
@@ -1435,10 +1435,10 @@ BOOL torture_denytest1(int dummy)
progress_bar(i, ARRAY_SIZE(denytable1));
- fnum1 = cli_open(cli1, fname,
+ fnum1 = cli_open(&cli1, fname,
denytable1[i].mode1,
denytable1[i].deny1);
- fnum2 = cli_open(cli1, fname,
+ fnum2 = cli_open(&cli1, fname,
denytable1[i].mode2,
denytable1[i].deny2);
@@ -1449,10 +1449,10 @@ BOOL torture_denytest1(int dummy)
} else {
char x = 1;
res = A_0;
- if (cli_read(cli1, fnum2, (void *)&x, 0, 1) == 1) {
+ if (cli_read(&cli1, fnum2, (void *)&x, 0, 1) == 1) {
res += A_R;
}
- if (cli_write(cli1, fnum2, 0, (void *)&x, 0, 1) == 1) {
+ if (cli_write(&cli1, fnum2, 0, (void *)&x, 0, 1) == 1) {
res += A_W;
}
}
@@ -1472,15 +1472,15 @@ BOOL torture_denytest1(int dummy)
resultstr(denytable1[i].result));
}
- cli_close(cli1, fnum1);
- cli_close(cli1, fnum2);
+ cli_close(&cli1, fnum1);
+ cli_close(&cli1, fnum2);
}
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i]);
+ cli_unlink(&cli1, fnames[i]);
}
- if (!torture_close_connection(cli1)) {
+ if (!torture_close_connection(&cli1)) {
correct = False;
}
@@ -1494,7 +1494,7 @@ BOOL torture_denytest1(int dummy)
*/
BOOL torture_denytest2(int dummy)
{
- static struct cli_state *cli1, *cli2;
+ static struct cli_state cli1, cli2;
int fnum1, fnum2;
int i;
BOOL correct = True;
@@ -1507,10 +1507,10 @@ BOOL torture_denytest2(int dummy)
printf("starting denytest2\n");
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i]);
- fnum1 = cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
- cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
- cli_close(cli1, fnum1);
+ cli_unlink(&cli1, fnames[i]);
+ fnum1 = cli_open(&cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
+ cli_write(&cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
+ cli_close(&cli1, fnum1);
}
for (i=0; i<ARRAY_SIZE(denytable2); i++) {
@@ -1519,10 +1519,10 @@ BOOL torture_denytest2(int dummy)
progress_bar(i, ARRAY_SIZE(denytable1));
- fnum1 = cli_open(cli1, fname,
+ fnum1 = cli_open(&cli1, fname,
denytable2[i].mode1,
denytable2[i].deny1);
- fnum2 = cli_open(cli2, fname,
+ fnum2 = cli_open(&cli2, fname,
denytable2[i].mode2,
denytable2[i].deny2);
@@ -1533,10 +1533,10 @@ BOOL torture_denytest2(int dummy)
} else {
char x = 1;
res = A_0;
- if (cli_read(cli2, fnum2, (void *)&x, 0, 1) == 1) {
+ if (cli_read(&cli2, fnum2, (void *)&x, 0, 1) == 1) {
res += A_R;
}
- if (cli_write(cli2, fnum2, 0, (void *)&x, 0, 1) == 1) {
+ if (cli_write(&cli2, fnum2, 0, (void *)&x, 0, 1) == 1) {
res += A_W;
}
}
@@ -1556,18 +1556,18 @@ BOOL torture_denytest2(int dummy)
resultstr(denytable2[i].result));
}
- cli_close(cli1, fnum1);
- cli_close(cli2, fnum2);
+ cli_close(&cli1, fnum1);
+ cli_close(&cli2, fnum2);
}
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i]);
+ cli_unlink(&cli1, fnames[i]);
}
- if (!torture_close_connection(cli1)) {
+ if (!torture_close_connection(&cli1)) {
correct = False;
}
- if (!torture_close_connection(cli2)) {
+ if (!torture_close_connection(&cli2)) {
correct = False;
}