• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From cef780e9ef86b1d9545db892c6b8340488da21d9 Mon Sep 17 00:00:00 2001
2From: Simon McVittie <smcv@collabora.com>
3Date: Thu, 23 Jun 2022 10:12:44 +0100
4Subject: [PATCH] giochannel: Add G_IO_FLAG_NONE
5
6This makes the state where no flags are set a bit more self-documenting.
7
8Signed-off-by: Simon McVittie <smcv@collabora.com>
9
10Conflict:NA
11Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/cef780e9ef86b1d9545db892c6b8340488da21d9
12
13---
14 glib/giochannel.c | 1 +
15 glib/giochannel.h | 1 +
16 glib/giounix.c    | 2 +-
17 3 files changed, 3 insertions(+), 1 deletion(-)
18
19diff --git a/glib/giochannel.c b/glib/giochannel.c
20index 6fec45f66d..25baf42c9a 100644
21--- a/glib/giochannel.c
22+++ b/glib/giochannel.c
23@@ -946,6 +946,7 @@ g_io_channel_get_line_term (GIOChannel *channel,
24  **/
25 /**
26  * GIOFlags:
27+ * @G_IO_FLAG_NONE: no special flags set. Since: 2.74
28  * @G_IO_FLAG_APPEND: turns on append mode, corresponds to %O_APPEND
29  *     (see the documentation of the UNIX open() syscall)
30  * @G_IO_FLAG_NONBLOCK: turns on nonblocking mode, corresponds to
31diff --git a/glib/giochannel.h b/glib/giochannel.h
32index 5a13449d58..dee3d7d055 100644
33--- a/glib/giochannel.h
34+++ b/glib/giochannel.h
35@@ -85,6 +85,7 @@ typedef enum
36
37 typedef enum
38 {
39+  G_IO_FLAG_NONE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
40   G_IO_FLAG_APPEND = 1 << 0,
41   G_IO_FLAG_NONBLOCK = 1 << 1,
42   G_IO_FLAG_IS_READABLE = 1 << 2,	/* Read only flag */
43diff --git a/glib/giounix.c b/glib/giounix.c
44index b6345b6c68..067cecf9ac 100644
45--- a/glib/giounix.c
46+++ b/glib/giounix.c
47@@ -400,7 +400,7 @@ g_io_unix_set_flags (GIOChannel *channel,
48 static GIOFlags
49 g_io_unix_get_flags (GIOChannel *channel)
50 {
51-  GIOFlags flags = 0;
52+  GIOFlags flags = G_IO_FLAG_NONE;
53   glong fcntl_flags;
54   GIOUnixChannel *unix_channel = (GIOUnixChannel *) channel;
55
56--
57GitLab
58
59