[SCM] Samba Shared Repository - branch master updated
Uri Simchoni
uri at samba.org
Tue Jul 12 11:57:06 UTC 2016
The branch, master has been updated
via 9d29593 tevent: Clarify apparently useless conditions
from 792f89c Fix typo in python/samba/provision/__init__.py
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9d29593d9224ba1d380bb697d45238f34c1edf53
Author: Nikolai Kondrashov <Nikolai.Kondrashov at redhat.com>
Date: Wed Jun 29 15:05:08 2016 +0300
tevent: Clarify apparently useless conditions
Comment on two similar conditions in tevent_standard.c, which,
otherwise, at a first glance, seem useless, i.e. always true.
The conditions checking glue->epoll_ops for being non-NULL, imply that
it *can* be NULL. A casual reader would not generally expect a "member"
function to modify its container's pointer in a container higher up, and
would assume that glue->epoll_ops could be NULL before the call,
resulting in a near-NULL pointer dereference.
However, in this case epoll_ops is indeed cleared in those "member"
functions, in the case of an epoll interface failure, to signify
fallback to poll interface.
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Uri Simchoni <uri at samba.org>
Autobuild-User(master): Uri Simchoni <uri at samba.org>
Autobuild-Date(master): Tue Jul 12 13:56:41 CEST 2016 on sn-devel-144
-----------------------------------------------------------------------
Summary of changes:
lib/tevent/tevent_standard.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Changeset truncated at 500 lines:
diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c
index a050901..30e9b91 100644
--- a/lib/tevent/tevent_standard.c
+++ b/lib/tevent/tevent_standard.c
@@ -112,6 +112,11 @@ static int std_event_loop_once(struct tevent_context *ev, const char *location)
int ret;
ret = glue->epoll_ops->loop_once(ev, location);
+ /*
+ * If the above hasn't panicked due to an epoll interface failure,
+ * std_fallback_to_poll() wasn't called, and hasn't cleared epoll_ops to
+ * signify fallback to poll_ops.
+ */
if (glue->epoll_ops != NULL) {
/* No fallback */
return ret;
@@ -138,6 +143,11 @@ static int std_event_loop_wait(struct tevent_context *ev, const char *location)
int ret;
ret = glue->epoll_ops->loop_wait(ev, location);
+ /*
+ * If the above hasn't panicked due to an epoll interface failure,
+ * std_fallback_to_poll() wasn't called, and hasn't cleared epoll_ops to
+ * signify fallback to poll_ops.
+ */
if (glue->epoll_ops != NULL) {
/* No fallback */
return ret;
--
Samba Shared Repository
More information about the samba-cvs
mailing list