Matthias Classen's patch to give g_io_channel_flush() the correct sense
authorRon Steinke <rsteinke@src.gnome.org>
Sun, 29 Jul 2001 17:43:20 +0000 (17:43 +0000)
committerRon Steinke <rsteinke@src.gnome.org>
Sun, 29 Jul 2001 17:43:20 +0000 (17:43 +0000)
        * glib/giochannel.c: Matthias Classen's patch to give
        g_io_channel_flush() the correct sense when testing
        whether the buffer is empty
        * glib/giounix.c: Matthias Classen's patch to set
        the mode of a file created with g_io_channel_new_file()

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/giounix.c

index 4c0030f..4359244 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 4c0030f..4359244 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-29  Ron Steinke  <rsteinke@w-link.net>
+
+       * glib/giochannel.c: Matthias Classen's patch to give
+       g_io_channel_flush() the correct sense when testing
+       whether the buffer is empty
+       * glib/giounix.c: Matthias Classen's patch to set
+       the mode of a file created with g_io_channel_new_file()
+
 Sun Jul 29 16:08:17 2001  Tim Janik  <timj@gtk.org>
 
        * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode().
index 01f503d..b9608f6 100644 (file)
@@ -821,7 +821,7 @@ g_io_channel_flush (GIOChannel      *channel,
   g_return_val_if_fail (channel != NULL, G_IO_STATUS_ERROR);
   g_return_val_if_fail ((error == NULL) || (*error == NULL), G_IO_STATUS_ERROR);
 
-  if (channel->write_buf && channel->write_buf->len > 0)
+  if (channel->write_buf == NULL || channel->write_buf->len == 0)
     return G_IO_STATUS_NORMAL;
 
   do
index 3218e5c..9c13d6c 100644 (file)
@@ -410,6 +410,7 @@ g_io_channel_new_file (const gchar *filename,
                        GError     **error)
 {
   int fid, flags;
+  mode_t create_mode;
   GIOChannel *channel;
   enum { /* Cheesy hack */
     MODE_R = 1 << 0,
@@ -479,7 +480,8 @@ g_io_channel_new_file (const gchar *filename,
         flags = 0;
     }
 
-  fid = open (filename, flags);
+  create_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+  fid = open (filename, flags, create_mode);
   if (fid < 0)
     {
       g_set_error (error, G_FILE_ERROR,