diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-04-13 15:37:05 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-13 15:37:05 -0500 |
commit | 8e15816ac1fccd0be4a1da2a6551870b769e0367 (patch) | |
tree | 35bf5ef80d3e94c8f7cbb897f9152e6a2d556849 /gatchat/gatutil.c | |
parent | c74e2ab189bfacd1075810c33cb426985414df66 (diff) | |
download | ofono-8e15816ac1fccd0be4a1da2a6551870b769e0367.tar.bz2 |
Fix: Don't try to set channel flags if they're 0
Diffstat (limited to 'gatchat/gatutil.c')
-rw-r--r-- | gatchat/gatutil.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gatchat/gatutil.c b/gatchat/gatutil.c index 1306c616..cbe38794 100644 --- a/gatchat/gatutil.c +++ b/gatchat/gatutil.c @@ -140,16 +140,17 @@ gboolean g_at_util_setup_io(GIOChannel *io, GIOFlags flags) G_IO_STATUS_NORMAL) return FALSE; - io_flags = g_io_channel_get_flags(io); + if (flags & G_IO_FLAG_SET_MASK) { + io_flags = g_io_channel_get_flags(io); - io_flags |= (flags & G_IO_FLAG_SET_MASK); + io_flags |= (flags & G_IO_FLAG_SET_MASK); - if (g_io_channel_set_flags(io, io_flags, NULL) != - G_IO_STATUS_NORMAL) - return FALSE; + if (g_io_channel_set_flags(io, io_flags, NULL) != + G_IO_STATUS_NORMAL) + return FALSE; + } g_io_channel_set_close_on_unref(io, TRUE); return TRUE; } - |