From: Colin Walters Date: Tue, 28 Jun 2011 16:52:58 +0000 (-0400) Subject: GCancellable: Fix build on Win32 X-Git-Tag: 2.29.10~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=315210ecdb98bc8effe6524ee24baba39cd48056;p=platform%2Fupstream%2Fglib.git GCancellable: Fix build on Win32 https://bugzilla.gnome.org/show_bug.cgi?id=653522 --- diff --git a/gio/gcancellable.c b/gio/gcancellable.c index f34761c..40185f7 100644 --- a/gio/gcancellable.c +++ b/gio/gcancellable.c @@ -195,17 +195,20 @@ g_cancellable_class_init (GCancellableClass *klass) } -#ifndef G_OS_WIN32 - static void g_cancellable_write_cancelled (GCancellable *cancellable) { +#ifdef G_OS_WIN32 + if (priv->event) + SetEvent (priv->event); +#else gssize c; GCancellablePrivate *priv; const char ch = 'x'; priv = cancellable->priv; + if (priv->cancel_pipe[0] == -1) return; @@ -227,8 +230,11 @@ g_cancellable_write_cancelled (GCancellable *cancellable) do c = write (priv->cancel_pipe[1], &ch, 1); while (c == -1 && errno == EINTR); +#endif } +#ifndef G_OS_WIN32 + static void g_cancellable_open_pipe (GCancellable *cancellable) { @@ -654,10 +660,6 @@ g_cancellable_cancel (GCancellable *cancellable) priv->cancelled = TRUE; priv->cancelled_running = TRUE; -#ifdef G_OS_WIN32 - if (priv->event) - SetEvent (priv->event); -#endif g_cancellable_write_cancelled (cancellable);