g_cancellable_get_fd: silently return -1 for NULL cancellable

This keeps compatibility with previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=655598

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
Owen W. Taylor 2011-07-29 15:38:54 -04:00 committed by David Zeuthen
parent 659ba3d0b3
commit ee63179b71

View File

@ -348,6 +348,9 @@ g_cancellable_get_fd (GCancellable *cancellable)
{
GPollFD pollfd;
if (cancellable == NULL)
return -1;
#ifdef G_OS_WIN32
pollfd.fd = -1;
#else