tevent: make sure we cleanup the array passed to poll() after deleting an event
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Feb 2013 13:41:24 +0000 (14:41 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 6 Mar 2013 09:12:00 +0000 (10:12 +0100)
commitce2082f42da43c97756b7d25f335e69a66e26b1e
treeafb5acb00a06b61d3ae6906a878c5ef1b15e6f25
parenta73331602625b5b5e8a3d6d86bd85658efb7c3ed
tevent: make sure we cleanup the array passed to poll() after deleting an event

If we don't cleanup the array passed to poll after an
event was deleted, we may pass a bad file descriptor to poll().

This was found by the following test failure in Samba's
autobuild, while removing the epoll support from
the "standard" backend.

    [48/1555 in 4m37s] samba3.smbtorture_s3.plain(s3dc).LOCK4
    UNEXPECTED(failure): samba3.smbtorture_s3.plain(s3dc).LOCK4.smbtorture(s3dc)
    REASON: _StringException: _StringException: using seed 1361530718
    host=127.0.0.2 share=tmp user=metze myname=sn-devel-104
    Running LOCK4
    starting locktest4
    Failed to create file: NT_STATUS_INVALID_HANDLE
    finished locktest4
    TEST LOCK4 FAILED!
    LOCK4 took 190.492 secs

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/tevent/tevent_poll.c