summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-02-10 11:33:35 +0000
committerTim Potter <tpot@samba.org>2004-02-10 11:33:35 +0000
commit9a6388179b9c4e13238ed91aebaca9b15e02408f (patch)
tree227d5e57dd0948abac7564a0d07f8fab8e6ae659 /source4/torture/raw
parente159cc7e05a46fcc652873b382b848f5d524d8b6 (diff)
downloadsamba-9a6388179b9c4e13238ed91aebaca9b15e02408f.tar.gz
samba-9a6388179b9c4e13238ed91aebaca9b15e02408f.tar.bz2
samba-9a6388179b9c4e13238ed91aebaca9b15e02408f.zip
Convert libcli routines to return NTSTATUS instead of BOOL. Again, the
only users are smbclient and smbtorture. (This used to be commit 54cb508c78e5c1faa3ade46b46b165983c880d10)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/chkpath.c2
-rw-r--r--source4/torture/raw/context.c6
-rw-r--r--source4/torture/raw/ioctl.c2
-rw-r--r--source4/torture/raw/lock.c6
-rw-r--r--source4/torture/raw/mux.c4
-rw-r--r--source4/torture/raw/open.c2
-rw-r--r--source4/torture/raw/read.c18
-rw-r--r--source4/torture/raw/rename.c4
-rw-r--r--source4/torture/raw/search.c2
-rw-r--r--source4/torture/raw/seek.c2
-rw-r--r--source4/torture/raw/setfileinfo.c4
-rw-r--r--source4/torture/raw/unlink.c2
-rw-r--r--source4/torture/raw/write.c10
13 files changed, 32 insertions, 32 deletions
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c
index 6e128a01a4..72ddf3b5a2 100644
--- a/source4/torture/raw/chkpath.c
+++ b/source4/torture/raw/chkpath.c
@@ -124,7 +124,7 @@ BOOL torture_raw_chkpath(int dummy)
printf("Failed to clean " BASEDIR "\n");
return False;
}
- if (!cli_mkdir(cli->tree, BASEDIR)) {
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 4fc9b3788e..91763da86f 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -60,7 +60,7 @@ static BOOL test_session(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING SESSION HANDLING\n");
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -168,7 +168,7 @@ static BOOL test_tree(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING TREE HANDLING\n");
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -270,7 +270,7 @@ static BOOL test_pid(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING PID HANDLING\n");
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/ioctl.c b/source4/torture/raw/ioctl.c
index a7787b6d28..4fd296d811 100644
--- a/source4/torture/raw/ioctl.c
+++ b/source4/torture/raw/ioctl.c
@@ -137,7 +137,7 @@ BOOL torture_raw_ioctl(int dummy)
printf("Failed to clean " BASEDIR "\n");
return False;
}
- if (!cli_mkdir(cli->tree, BASEDIR)) {
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index e36f9edddf..9a9b841568 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -51,7 +51,7 @@ static BOOL test_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname = BASEDIR "\\test.txt";
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -153,7 +153,7 @@ static BOOL test_lockx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname = BASEDIR "\\test.txt";
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -203,7 +203,7 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx)
char c = 1;
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c
index 70e6c09d9e..8b3bcc12e3 100644
--- a/source4/torture/raw/mux.c
+++ b/source4/torture/raw/mux.c
@@ -110,7 +110,7 @@ static BOOL test_mux_write(struct cli_state *cli, TALLOC_CTX *mem_ctx)
cli->session->pid = 1;
/* lock a range */
- if (!cli_lock(cli->tree, fnum, 0, 4, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 0, 4, 0, WRITE_LOCK))) {
printf("lock failed in mux_write - %s\n", cli_errstr(cli->tree));
ret = False;
goto done;
@@ -271,7 +271,7 @@ BOOL torture_raw_mux(int dummy)
}
- if (!cli_mkdir(cli->tree, BASEDIR)) {
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Failed to create %s\n", BASEDIR);
ret = False;
goto done;
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index 567940b2e8..d2055536a1 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -912,7 +912,7 @@ BOOL torture_raw_open(int dummy)
printf("Failed to clean " BASEDIR "\n");
return False;
}
- if (!cli_mkdir(cli->tree, BASEDIR)) {
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index 0836b4d021..3e9547856c 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -91,7 +91,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -178,7 +178,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Trying locked region\n");
cli->session->pid++;
- if (!cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
ret = False;
goto done;
@@ -217,7 +217,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -322,7 +322,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Trying locked region\n");
cli->session->pid++;
- if (!cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
ret = False;
goto done;
@@ -360,7 +360,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -489,7 +489,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Trying locked region\n");
cli->session->pid++;
- if (!cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
ret = False;
goto done;
@@ -511,7 +511,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.readx.out.nread, 0);
- if (!cli_lock64(cli->tree, fnum, io.readx.in.offset, 1, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock64(cli->tree, fnum, io.readx.in.offset, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
ret = False;
goto done;
@@ -547,7 +547,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -660,7 +660,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Trying locked region\n");
cli->session->pid++;
- if (!cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
ret = False;
goto done;
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c
index d2f922cdfd..98a6ce5fde 100644
--- a/source4/torture/raw/rename.c
+++ b/source4/torture/raw/rename.c
@@ -52,7 +52,7 @@ static BOOL test_mv(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Testing SMBmv\n");
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -142,7 +142,7 @@ static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Testing SMBntrename\n");
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 164c9bb4d8..9881a45cb1 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -551,7 +551,7 @@ static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx)
};
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/seek.c b/source4/torture/raw/seek.c
index fa95156969..89528c72ad 100644
--- a/source4/torture/raw/seek.c
+++ b/source4/torture/raw/seek.c
@@ -53,7 +53,7 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx)
char c[2];
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index f82a63180a..fa286ae4da 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -500,10 +500,10 @@ BOOL torture_raw_sfileinfo(int dummy)
done:
smb_raw_exit(cli->session);
cli_close(cli->tree, fnum);
- if (!cli_unlink(cli->tree, fnum_fname)) {
+ if (NT_STATUS_IS_ERR(cli_unlink(cli->tree, fnum_fname))) {
printf("Failed to delete %s - %s\n", fnum_fname, cli_errstr(cli->tree));
}
- if (!cli_unlink(cli->tree, path_fname)) {
+ if (NT_STATUS_IS_ERR(cli_unlink(cli->tree, path_fname))) {
printf("Failed to delete %s - %s\n", path_fname, cli_errstr(cli->tree));
}
diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c
index 741f8c61f7..f4598bc1d7 100644
--- a/source4/torture/raw/unlink.c
+++ b/source4/torture/raw/unlink.c
@@ -41,7 +41,7 @@ static BOOL test_unlink(struct cli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname = BASEDIR "\\test.txt";
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index 3b356f1095..eb20fe3b84 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -104,7 +104,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -223,7 +223,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -312,7 +312,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx)
printf("Trying locked region\n");
cli->session->pid++;
- if (!cli_lock(cli->tree, fnum, 3, 1, 0, WRITE_LOCK)) {
+ if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 3, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
ret = False;
goto done;
@@ -397,7 +397,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}
@@ -536,7 +536,7 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx)
buf = talloc_zero(mem_ctx, maxsize);
if (cli_deltree(cli->tree, BASEDIR) == -1 ||
- !cli_mkdir(cli->tree, BASEDIR)) {
+ NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) {
printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree));
return False;
}