summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 3a1514f1aa4..d48c081e217 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3677,11 +3677,15 @@ static BOOL recursive_rmdir(connection_struct *conn, char *directory)
BOOL rmdir_internals(connection_struct *conn, const char *directory)
{
- BOOL ok;
+ int ret;
SMB_STRUCT_STAT st;
- ok = (SMB_VFS_RMDIR(conn,directory) == 0);
- if(!ok && ((errno == ENOTEMPTY)||(errno == EEXIST)) && lp_veto_files(SNUM(conn))) {
+ ret = SMB_VFS_RMDIR(conn,directory);
+ if (ret == 0) {
+ return True;
+ }
+
+ if(((errno == ENOTEMPTY)||(errno == EEXIST)) && lp_veto_files(SNUM(conn))) {
/*
* Check to see if the only thing in this directory are
* vetoed files/directories. If so then delete them and
@@ -3744,12 +3748,12 @@ BOOL rmdir_internals(connection_struct *conn, const char *directory)
}
CloseDir(dir_hnd);
/* Retry the rmdir */
- ok = (SMB_VFS_RMDIR(conn,directory) == 0);
+ ret = SMB_VFS_RMDIR(conn,directory);
}
err:
- if (!ok) {
+ if (ret != 0) {
DEBUG(3,("rmdir_internals: couldn't remove directory %s : "
"%s\n", directory,strerror(errno)));
return False;