• M
    virNetSocket: Fix @watch corner case · 9ee5a798
    Michal Privoznik 提交于
    Although highly unlikely, nobody says that virEventAddHandle()
    can't return 0 as a handle to socket callback. It can't happen
    with our default implementation since all watches will have value
    1 or greater, but users can register their own callback functions
    (which can re-use unused watch IDs for instance). If this is the
    case, weird things may happen.
    
    Also, there's a little bug I'm fixing too, upon
    virNetSocketRemoveIOCallback(), the variable holding callback ID
    was not reset. Therefore calling AddIOCallback() once again would
    fail. Not that we are doing it right now, but we might.
    Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
    9ee5a798
virnetsocket.c 54.8 KB