From ee63179b71f6a4153f08bc5c84c24a0d0ac76263 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 29 Jul 2011 15:38:54 -0400 Subject: [PATCH] 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 --- gio/gcancellable.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/gcancellable.c b/gio/gcancellable.c index 1c3c5b5d5..8ed1b2639 100644 --- a/gio/gcancellable.c +++ b/gio/gcancellable.c @@ -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 -- 2.34.1