Handle NUL bytes_written, bytes_read. (Suggested by Joshua N Pritikin,
authorOwen Taylor <otaylor@redhat.com>
Wed, 19 Sep 2001 17:06:14 +0000 (17:06 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 19 Sep 2001 17:06:14 +0000 (17:06 +0000)
Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>

* glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)

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

index fb5964c..4d21157 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index fb5964c..4d21157 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 19 13:03:38 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/giochannel.c (g_io_channel_read/write_chars): Handle NUL
+       bytes_written, bytes_read. (Suggested by Joshua N Pritikin, #59550)
+
 Wed Sep 19 12:49:11 2001  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gutils.c (g_get_any_init): Handle failure of
index 50bd8e9..bebab83 100644 (file)
@@ -907,9 +907,9 @@ g_io_channel_flush (GIOChannel      *channel,
       g_assert (this_time > 0);
 
       status = channel->funcs->io_write (channel,
-                                      channel->write_buf->str + bytes_written,
-                                      channel->write_buf->len - bytes_written,
-                                      &this_time, error);
+                                        channel->write_buf->str + bytes_written,
+                                        channel->write_buf->len - bytes_written,
+                                        &this_time, error);
       bytes_written += this_time;
     }
   while ((bytes_written < channel->write_buf->len)
@@ -1722,9 +1722,16 @@ g_io_channel_read_chars (GIOChannel      *channel,
 
   if (!channel->use_buffer)
     {
+      gint tmp_bytes;
+      
       g_assert (!channel->read_buf || channel->read_buf->len == 0);
 
-      return channel->funcs->io_read (channel, buf, count, bytes_read, error);
+      status = channel->funcs->io_read (channel, buf, count, &tmp_bytes, error);
+      
+      if (bytes_read)
+       *bytes_read = tmp_bytes;
+
+      return status;
     }
 
   status = G_IO_STATUS_NORMAL;
@@ -1907,9 +1914,17 @@ g_io_channel_write_chars (GIOChannel     *channel,
 
   if (!channel->use_buffer)
     {
+      gint tmp_bytes;
+      
       g_assert (!channel->write_buf || channel->write_buf->len == 0);
       g_assert (channel->partial_write_buf[0] == '\0');
-      return channel->funcs->io_write (channel, buf, count, bytes_written, error);
+      
+      status = channel->funcs->io_write (channel, buf, count, &tmp_bytes, error);
+
+      if (bytes_written)
+       *bytes_written = tmp_bytes;
+
+      return status;
     }
 
   /* General case */