tevent: Clarify apparently useless conditions
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Wed, 29 Jun 2016 12:05:08 +0000 (15:05 +0300)
committerUri Simchoni <uri@samba.org>
Tue, 12 Jul 2016 11:56:41 +0000 (13:56 +0200)
commit9d29593d9224ba1d380bb697d45238f34c1edf53
tree1411c60d319cb6a3541184e85caa0c34bbdc884f
parent792f89cdb67ec53a5148acc79a8e052187c4d622
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@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Jul 12 13:56:41 CEST 2016 on sn-devel-144
lib/tevent/tevent_standard.c