mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
libsmb: Make cli_posix_unlink/rmdir proper tevent_req/subreq pairs
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Mar 2 00:55:56 UTC 2019 on sn-devel-144
This commit is contained in:
parent
65c269d538
commit
d1c2fe8907
@ -5486,13 +5486,43 @@ static void cli_posix_unlink_internal_done(struct tevent_req *subreq)
|
||||
tevent_req_simple_finish_ntstatus(subreq, status);
|
||||
}
|
||||
|
||||
static NTSTATUS cli_posix_unlink_internal_recv(struct tevent_req *req)
|
||||
{
|
||||
return tevent_req_simple_recv_ntstatus(req);
|
||||
}
|
||||
|
||||
struct cli_posix_unlink_state {
|
||||
uint8_t dummy;
|
||||
};
|
||||
|
||||
static void cli_posix_unlink_done(struct tevent_req *subreq);
|
||||
|
||||
struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
struct cli_state *cli,
|
||||
const char *fname)
|
||||
{
|
||||
return cli_posix_unlink_internal_send(mem_ctx, ev, cli, fname,
|
||||
SMB_POSIX_UNLINK_FILE_TARGET);
|
||||
struct tevent_req *req = NULL, *subreq = NULL;
|
||||
struct cli_posix_unlink_state *state;
|
||||
|
||||
req = tevent_req_create(
|
||||
mem_ctx, &state, struct cli_posix_unlink_state);
|
||||
if (req == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
subreq = cli_posix_unlink_internal_send(
|
||||
mem_ctx, ev, cli, fname, SMB_POSIX_UNLINK_FILE_TARGET);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
tevent_req_set_callback(subreq, cli_posix_unlink_done, req);
|
||||
return req;
|
||||
}
|
||||
|
||||
static void cli_posix_unlink_done(struct tevent_req *subreq)
|
||||
{
|
||||
NTSTATUS status = cli_posix_unlink_internal_recv(subreq);
|
||||
tevent_req_simple_finish_ntstatus(subreq, status);
|
||||
}
|
||||
|
||||
NTSTATUS cli_posix_unlink_recv(struct tevent_req *req)
|
||||
@ -5549,14 +5579,37 @@ NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname)
|
||||
rmdir - POSIX semantics.
|
||||
****************************************************************************/
|
||||
|
||||
struct cli_posix_rmdir_state {
|
||||
uint8_t dummy;
|
||||
};
|
||||
|
||||
static void cli_posix_rmdir_done(struct tevent_req *subreq);
|
||||
|
||||
struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
struct cli_state *cli,
|
||||
const char *fname)
|
||||
{
|
||||
return cli_posix_unlink_internal_send(
|
||||
mem_ctx, ev, cli, fname,
|
||||
SMB_POSIX_UNLINK_DIRECTORY_TARGET);
|
||||
struct tevent_req *req = NULL, *subreq = NULL;
|
||||
struct cli_posix_rmdir_state *state;
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state, struct cli_posix_rmdir_state);
|
||||
if (req == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
subreq = cli_posix_unlink_internal_send(
|
||||
mem_ctx, ev, cli, fname, SMB_POSIX_UNLINK_DIRECTORY_TARGET);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
tevent_req_set_callback(subreq, cli_posix_rmdir_done, req);
|
||||
return req;
|
||||
}
|
||||
|
||||
static void cli_posix_rmdir_done(struct tevent_req *subreq)
|
||||
{
|
||||
NTSTATUS status = cli_posix_unlink_internal_recv(subreq);
|
||||
tevent_req_simple_finish_ntstatus(subreq, status);
|
||||
}
|
||||
|
||||
NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user