make the code actually have an effect (Use |= to set bits). Not absolutely

2001-07-22  Hans Breuer  <hans@breuer.org>

	* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
	the code actually have an effect (Use |= to set bits). Not
	absolutely sure if is the right one.

	* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
	watch->condition but restored the previous behaviour.
	Now gio-test as well as The Gimp work again ...
This commit is contained in:
Hans Breuer
2001-07-22 21:15:22 +00:00
committed by Hans Breuer
parent 838ed39262
commit 371fe04203
10 changed files with 92 additions and 8 deletions

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -1,3 +1,13 @@
2001-07-22 Hans Breuer <hans@breuer.org>
* glib/giochannel.c (g_io_channel_get_buffer_condition) : make
the code actually have an effect (Use |= to set bits). Not
absolutely sure if is the right one.
* glib/giowin32.c (g_io_win32_<check|prepare>) : don't modify
watch->condition but restored the previous behaviour.
Now gio-test as well as The Gimp work again ...
2001-07-21 Hans Breuer <hans@breuer.org> 2001-07-21 Hans Breuer <hans@breuer.org>
* glib/giowin32.c (g_io_channel_new_file) : set the * glib/giowin32.c (g_io_channel_new_file) : set the

View File

@@ -479,10 +479,10 @@ g_io_channel_get_buffer_condition (GIOChannel *channel)
if ((channel->read_buf && (channel->read_buf->len > 0)) /* FIXME full chars how? */ if ((channel->read_buf && (channel->read_buf->len > 0)) /* FIXME full chars how? */
|| (channel->encoded_read_buf && (channel->encoded_read_buf->len > 0))) || (channel->encoded_read_buf && (channel->encoded_read_buf->len > 0)))
condition &= G_IO_IN; condition |= G_IO_IN;
if (channel->write_buf && (channel->write_buf->len < channel->buf_size)) if (channel->write_buf && (channel->write_buf->len < channel->buf_size))
condition &= G_IO_OUT; condition |= G_IO_OUT;
return condition; return condition;
} }

View File

@@ -321,7 +321,7 @@ buffer_read (GIOWin32Channel *channel,
{ {
UNLOCK (channel->mutex); UNLOCK (channel->mutex);
*bytes_read = 0; *bytes_read = 0;
return G_IO_STATUS_EOF; /* Is this correct? FIXME */ return G_IO_STATUS_NORMAL; /* as before, normal case ? */
} }
} }
@@ -514,6 +514,8 @@ g_io_win32_prepare (GSource *source,
channel->thread_id); channel->thread_id);
} }
return FALSE;
/* XXX: why should we want to do this ? */
watch->condition = g_io_channel_get_buffer_condition (watch->channel); watch->condition = g_io_channel_get_buffer_condition (watch->channel);
return (watch->pollfd.revents & (G_IO_IN | G_IO_OUT)) == watch->condition; return (watch->pollfd.revents & (G_IO_IN | G_IO_OUT)) == watch->condition;
@@ -525,6 +527,8 @@ g_io_win32_check (GSource *source)
MSG msg; MSG msg;
GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOWin32Watch *watch = (GIOWin32Watch *)source;
GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel; GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel;
GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel);
if (channel->debug) if (channel->debug)
g_print ("g_io_win32_check: for thread %#x:\n" g_print ("g_io_win32_check: for thread %#x:\n"
@@ -552,8 +556,6 @@ g_io_win32_check (GSource *source)
channel->thread_id); channel->thread_id);
} }
watch->condition &= g_io_channel_get_buffer_condition (watch->channel);
return (watch->pollfd.revents & watch->condition); return (watch->pollfd.revents & watch->condition);
} }
@@ -659,7 +661,7 @@ g_io_win32_msg_read (GIOChannel *channel,
win32_channel->hwnd); win32_channel->hwnd);
if (!PeekMessage (&msg, win32_channel->hwnd, 0, 0, PM_REMOVE)) if (!PeekMessage (&msg, win32_channel->hwnd, 0, 0, PM_REMOVE))
return G_IO_STATUS_AGAIN; return G_IO_STATUS_AGAIN;
memmove (buf, &msg, sizeof (MSG)); memmove (buf, &msg, sizeof (MSG));
*bytes_read = sizeof (MSG); *bytes_read = sizeof (MSG);
@@ -804,6 +806,7 @@ g_io_win32_fd_read (GIOChannel *channel,
*bytes_read = result; *bytes_read = result;
return G_IO_STATUS_NORMAL; /* XXX: 0 byte read an error ?? */
return (result > 0) ? G_IO_STATUS_NORMAL : G_IO_STATUS_EOF; return (result > 0) ? G_IO_STATUS_NORMAL : G_IO_STATUS_EOF;
} }
@@ -975,6 +978,7 @@ repeat:
{ {
*bytes_read = result; *bytes_read = result;
return G_IO_STATUS_NORMAL; /* XXX: 0 byte read an error ?? */
return (result > 0) ? G_IO_STATUS_NORMAL : G_IO_STATUS_EOF; return (result > 0) ? G_IO_STATUS_NORMAL : G_IO_STATUS_EOF;
} }
} }
@@ -1101,7 +1105,7 @@ g_io_channel_new_file (const gchar *filename,
mode_num = MODE_A; mode_num = MODE_A;
break; break;
default: default:
g_warning ("Invalid GIOFileMode %s.\n", mode); g_warning (G_STRLOC ": Invalid GIOFileMode %s.\n", mode);
return NULL; return NULL;
} }
@@ -1117,7 +1121,7 @@ g_io_channel_new_file (const gchar *filename,
} }
/* Fall through */ /* Fall through */
default: default:
g_warning ("Invalid GIOFileMode %s.\n", mode); g_warning (G_STRLOC ": Invalid GIOFileMode %s.\n", mode);
return NULL; return NULL;
} }