[libvirt] [PATCH] docs: fix virEventAddHandle return details

In commit 6d41cb8, the interface for virEventAddHandleFunc was changed. This patch updates the documentation for virEventAddHandle to reflect the new significance of the return value. Also, both functions now mention -1 for failure. --- include/libvirt/libvirt.h.in | 4 ++-- src/util/virevent.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index a47e33c..7944dfb 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -3643,8 +3643,8 @@ typedef void (*virEventHandleCallback)(int watch, int fd, int events, void *opaq * If 'ff' callbacks are invoked directly from the virEventRemoveHandleFunc * they will likely deadlock in libvirt. * - * Returns a handle watch number to be used for updating - * and unregistering for events + * Returns -1 if the file handle cannot be registered, otherwise a handle + * watch number to be used for updating and unregistering for events */ typedef int (*virEventAddHandleFunc)(int fd, int event, virEventHandleCallback cb, diff --git a/src/util/virevent.c b/src/util/virevent.c index 886cb6d..fde29a2 100644 --- a/src/util/virevent.c +++ b/src/util/virevent.c @@ -48,7 +48,8 @@ static virEventRemoveTimeoutFunc removeTimeoutImpl = NULL; * * Register a callback for monitoring file handle events. * - * Returns -1 if the file handle cannot be registered, 0 upon success + * Returns -1 if the file handle cannot be registered, otherwise a handle + * watch number to be used for updating and unregistering for events */ int virEventAddHandle(int fd, -- 1.8.3.1

On 09/18/2013 12:56 PM, Jonathan Lebon wrote:
In commit 6d41cb8, the interface for virEventAddHandleFunc was changed. This patch updates the documentation for virEventAddHandle to reflect the new significance of the return value. Also, both functions now mention -1 for failure. --- include/libvirt/libvirt.h.in | 4 ++-- src/util/virevent.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
ACK and pushed; congrats on your first libvirt patch. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Jonathan Lebon