summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2020-11-09 19:48:21 +0100
committerJeremy Allison <jra@samba.org>2020-11-16 19:53:44 +0000
commitd33cec8d4487129cc29398fb00e1d81ae8ce7fb9 (patch)
tree2e5363b849a4b94a9cdf2ba7469368c8aedac5e9 /source3/libsmb
parent5ee42dd0e9c4405b5c8bf58fd16ef0878763a330 (diff)
downloadsamba-d33cec8d4487129cc29398fb00e1d81ae8ce7fb9.tar.gz
pylibsmb: Merge remove_dir() into its only caller
Now that delete_tree is in python code, align py_smb_rmdir() with the other functions. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/pylibsmb.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index 28a21b535d5..3c59ef5ba50 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -1260,34 +1260,22 @@ static PyObject *py_smb_unlink(struct py_cli_state *self, PyObject *args)
Py_RETURN_NONE;
}
-/*
- * Delete an empty directory
- */
-static NTSTATUS remove_dir(struct py_cli_state *self, const char *dirname)
-{
- NTSTATUS status;
- struct tevent_req *req = NULL;
-
- req = cli_rmdir_send(NULL, self->ev, self->cli, dirname);
- if (!py_tevent_req_wait_exc(self, req)) {
- return NT_STATUS_INTERNAL_ERROR;
- }
- status = cli_rmdir_recv(req);
- TALLOC_FREE(req);
-
- return status;
-}
-
static PyObject *py_smb_rmdir(struct py_cli_state *self, PyObject *args)
{
NTSTATUS status;
+ struct tevent_req *req = NULL;
const char *dirname = NULL;
if (!PyArg_ParseTuple(args, "s:rmdir", &dirname)) {
return NULL;
}
- status = remove_dir(self, dirname);
+ req = cli_rmdir_send(NULL, self->ev, self->cli, dirname);
+ if (!py_tevent_req_wait_exc(self, req)) {
+ return NULL;
+ }
+ status = cli_rmdir_recv(req);
+ TALLOC_FREE(req);
PyErr_NTSTATUS_IS_ERR_RAISE(status);
Py_RETURN_NONE;