tevent: make sure we cleanup the array passed to poll() after deleting an event
commit8e3ef659f876573bd7abb7d0e707369157232125
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Feb 2013 13:41:24 +0000 (21 14:41 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 1 Mar 2013 19:59:28 +0000 (1 11:59 -0800)
treed8d3365bc4d4b38f44bef402b8ac15b2c3ed71d9
parentd5b341d873bc326843d80dd15d3cd3ef465234ae
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