summaryrefslogtreecommitdiff
path: root/source4/libcli/clideltree.c
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/libcli/clideltree.c
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/libcli/clideltree.c')
-rw-r--r--source4/libcli/clideltree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c
index d28950f136..2bbfd9bd22 100644
--- a/source4/libcli/clideltree.c
+++ b/source4/libcli/clideltree.c
@@ -41,7 +41,7 @@ static void delete_fn(file_info *finfo, const char *name, void *state)
asprintf(&s, "%s%s", n, finfo->name);
if (finfo->mode & FILE_ATTRIBUTE_READONLY) {
- if (!cli_setatr(dstate->tree, s, 0, 0)) {
+ if (NT_STATUS_IS_ERR(cli_setatr(dstate->tree, s, 0, 0))) {
DEBUG(2,("Failed to remove READONLY on %s - %s\n",
s, cli_errstr(dstate->tree)));
}
@@ -55,14 +55,14 @@ static void delete_fn(file_info *finfo, const char *name, void *state)
FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM,
delete_fn, state);
free(s2);
- if (!cli_rmdir(dstate->tree, s)) {
+ if (NT_STATUS_IS_ERR(cli_rmdir(dstate->tree, s))) {
DEBUG(2,("Failed to delete %s - %s\n",
s, cli_errstr(dstate->tree)));
dstate->failed = True;
}
dstate->total_deleted++;
} else {
- if (!cli_unlink(dstate->tree, s)) {
+ if (NT_STATUS_IS_ERR(cli_unlink(dstate->tree, s))) {
DEBUG(2,("Failed to delete %s - %s\n",
s, cli_errstr(dstate->tree)));
dstate->failed = True;
@@ -87,7 +87,7 @@ int cli_deltree(struct cli_tree *tree, const char *dname)
dstate.failed = False;
/* it might be a file */
- if (cli_unlink(tree, dname)) {
+ if (NT_STATUS_IS_OK(cli_unlink(tree, dname))) {
return 1;
}
if (NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_OBJECT_NAME_NOT_FOUND) ||
@@ -102,7 +102,7 @@ int cli_deltree(struct cli_tree *tree, const char *dname)
FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM,
delete_fn, &dstate);
free(mask);
- if (!cli_rmdir(dstate.tree, dname)) {
+ if (NT_STATUS_IS_ERR(cli_rmdir(dstate.tree, dname))) {
DEBUG(2,("Failed to delete %s - %s\n",
dname, cli_errstr(dstate.tree)));
return -1;