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)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Mar 2013 09:48:39 +0000 (10:48 +0100)
commit0c0f9fc6dba7c2a0f0aec7d3a49aab428076040a
treed8d3365bc4d4b38f44bef402b8ac15b2c3ed71d9
parent412299a6385b12687a0797b2219188fd5bc9eb71
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>
lib/tevent/tevent_poll.c