make the code actually have an effect (Use |= to set bits). Not absolutely
authorHans Breuer <hans@breuer.org>
Sun, 22 Jul 2001 21:15:22 +0000 (21:15 +0000)
committerHans Breuer <hans@src.gnome.org>
Sun, 22 Jul 2001 21:15:22 +0000 (21:15 +0000)
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 ...

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/giochannel.c
glib/giowin32.c

index a353a6b..161333f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index a353a6b..161333f 100644 (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>
 
        * glib/giowin32.c (g_io_channel_new_file) : set the
index 1560920..bfe42cc 100644 (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? */
     || (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))
-    condition &= G_IO_OUT;
+    condition |= G_IO_OUT;
 
   return condition;
 }
index 18cd1b1..84e0009 100644 (file)
@@ -321,7 +321,7 @@ buffer_read (GIOWin32Channel *channel,
        {
          UNLOCK (channel->mutex);
           *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);
     }
 
+  return FALSE;
+  /* XXX: why should we want to do this ? */
   watch->condition = g_io_channel_get_buffer_condition (watch->channel);
 
   return (watch->pollfd.revents & (G_IO_IN | G_IO_OUT)) == watch->condition;
@@ -525,6 +527,8 @@ g_io_win32_check (GSource *source)
        MSG msg;
   GIOWin32Watch *watch = (GIOWin32Watch *)source;
   GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel;
+  GIOCondition buffer_condition = g_io_channel_get_buffer_condition (watch->channel);
+
   
   if (channel->debug)
     g_print ("g_io_win32_check: for thread %#x:\n"
@@ -552,8 +556,6 @@ g_io_win32_check (GSource *source)
                 channel->thread_id);
     }
 
-  watch->condition &= g_io_channel_get_buffer_condition (watch->channel);
-  
   return (watch->pollfd.revents & watch->condition);
 }
 
@@ -659,7 +661,7 @@ g_io_win32_msg_read (GIOChannel *channel,
             win32_channel->hwnd);
   if (!PeekMessage (&msg, win32_channel->hwnd, 0, 0, PM_REMOVE))
     return G_IO_STATUS_AGAIN;
-  
+
   memmove (buf, &msg, sizeof (MSG));
   *bytes_read = sizeof (MSG);
 
@@ -804,6 +806,7 @@ g_io_win32_fd_read (GIOChannel *channel,
 
   *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;
 }
 
@@ -975,6 +978,7 @@ repeat:
     {
       *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;
     }
 }
@@ -1101,7 +1105,7 @@ g_io_channel_new_file (const gchar  *filename,
         mode_num = MODE_A;
         break;
       default:
-        g_warning ("Invalid GIOFileMode %s.\n", mode);
+        g_warning (G_STRLOC ": Invalid GIOFileMode %s.\n", mode);
         return NULL;
     }
 
@@ -1117,7 +1121,7 @@ g_io_channel_new_file (const gchar  *filename,
           }
         /* Fall through */
       default:
-        g_warning ("Invalid GIOFileMode %s.\n", mode);
+        g_warning (G_STRLOC ": Invalid GIOFileMode %s.\n", mode);
         return NULL;
     }