From e669b218a12dda02c9cb61517aa472b7fbd3f43b Mon Sep 17 00:00:00 2001 From: Ron Steinke Date: Sun, 29 Jul 2001 17:43:20 +0000 Subject: [PATCH] Matthias Classen's patch to give g_io_channel_flush() the correct sense * 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 | 8 ++++++++ ChangeLog.pre-2-0 | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-12 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ glib/giochannel.c | 2 +- glib/giounix.c | 4 +++- 10 files changed, 68 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c0030fec..4359244d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4c0030fec..4359244d1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2001-07-29 Ron Steinke + + * 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 * glib/gscanner.[hc]: removed deprecated g_scanner_stat_mode(). diff --git a/glib/giochannel.c b/glib/giochannel.c index 01f503da9..b9608f6ee 100644 --- a/glib/giochannel.c +++ b/glib/giochannel.c @@ -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 diff --git a/glib/giounix.c b/glib/giounix.c index 3218e5cd7..9c13d6c83 100644 --- a/glib/giounix.c +++ b/glib/giounix.c @@ -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,