priv variable should only be used in win32 code

This commit is contained in:
Juan A. Suarez Romero 2009-11-20 16:46:41 +01:00 committed by Benjamin Otte
parent 8e2fa44953
commit ba2b2bbca2

View File

@ -503,14 +503,15 @@ g_cancellable_get_fd (GCancellable *cancellable)
gboolean gboolean
g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd) g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd)
{ {
GCancellablePrivate *priv;
g_return_val_if_fail (pollfd != NULL, FALSE); g_return_val_if_fail (pollfd != NULL, FALSE);
if (cancellable == NULL) if (cancellable == NULL)
return FALSE; return FALSE;
g_return_val_if_fail (G_IS_CANCELLABLE (cancellable), FALSE); g_return_val_if_fail (G_IS_CANCELLABLE (cancellable), FALSE);
{
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GCancellablePrivate *priv;
priv = cancellable->priv; priv = cancellable->priv;
G_LOCK(cancellable); G_LOCK(cancellable);
if (priv->event == NULL) if (priv->event == NULL)
@ -530,13 +531,14 @@ g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd)
pollfd->fd = (gintptr)priv->event; pollfd->fd = (gintptr)priv->event;
#else /* !G_OS_WIN32 */ #else /* !G_OS_WIN32 */
{
int fd = g_cancellable_get_fd (cancellable); int fd = g_cancellable_get_fd (cancellable);
if (fd == -1) if (fd == -1)
return FALSE; return FALSE;
pollfd->fd = fd; pollfd->fd = fd;
}
#endif /* G_OS_WIN32 */ #endif /* G_OS_WIN32 */
}
pollfd->events = G_IO_IN; pollfd->events = G_IO_IN;
pollfd->revents = 0; pollfd->revents = 0;