From: Volker Lendecke Date: Tue, 30 Jul 2019 12:51:00 +0000 (+0200) Subject: smbd: Make setup_poll_open() return bool X-Git-Tag: tdb-1.4.2~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50a3d08673ad5a62ff5769af429e2cc1730a1659;p=thirdparty%2Fsamba.git smbd: Make setup_poll_open() return bool This is for callers who don't want to call open_was_deferred() afterwards Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 94756925693..6e88b815988 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2508,7 +2508,7 @@ static void poll_open_fn(struct tevent_context *ev, /** * Reschedule an open for 1 second from now, if not timed out. **/ -static void setup_poll_open( +static bool setup_poll_open( struct smb_request *req, struct file_id id, struct timeval max_timeout, @@ -2520,13 +2520,13 @@ static void setup_poll_open( /* Maximum wait time. */ if (request_timed_out(req, max_timeout)) { - return; + return false; } open_rec = talloc_zero(NULL, struct deferred_open_record); if (open_rec == NULL) { DBG_WARNING("talloc failed\n"); - return; + return false; } open_rec->xconn = req->xconn; open_rec->mid = req->mid; @@ -2540,20 +2540,22 @@ static void setup_poll_open( if (open_rec->te == NULL) { DBG_WARNING("tevent_add_timer failed\n"); TALLOC_FREE(open_rec); - return; + return false; } ok = push_deferred_open_message_smb(req, max_timeout, id, open_rec); if (!ok) { DBG_WARNING("push_deferred_open_message_smb failed\n"); TALLOC_FREE(open_rec); - return; + return false; } DBG_DEBUG("poll request time [%s] mid [%" PRIu64 "] file_id [%s]\n", timeval_string(talloc_tos(), &req->request_time, false), req->mid, file_id_string_tos(&id)); + + return true; } /****************************************************************************