summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2023-05-31 16:28:06 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2023-08-16 14:02:35 +0100
commitde6cebb5f67577ddf438906d7cba7d62fb04631c (patch)
tree47aaf0d8aa80f7aae88d411c17ee39cd517261d0
parent40508b35b9c74171560dc9e627a35be2d7fb1db5 (diff)
downloadglib-de6cebb5f67577ddf438906d7cba7d62fb04631c.tar.gz
glib-unix: Don't fall back from O_NONBLOCK to O_NDELAY
Since 5c65437d "glib-unix: Add O_NONBLOCK support to g_unix_open_pipe()" we have been using O_NONBLOCK unconditionally, so we might as well drop the fallback here as well. This commit should be reverted if someone reports a significant/supported platform that genuinely doesn't have O_NONBLOCK. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--glib/glib-unix.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/glib/glib-unix.c b/glib/glib-unix.c
index c25cd30f0..0532a500c 100644
--- a/glib/glib-unix.c
+++ b/glib/glib-unix.c
@@ -139,21 +139,9 @@ g_unix_set_fd_nonblocking (gint fd,
return g_unix_set_error_from_errno (error, errno);
if (nonblock)
- {
-#ifdef O_NONBLOCK
- fcntl_flags |= O_NONBLOCK;
-#else
- fcntl_flags |= O_NDELAY;
-#endif
- }
+ fcntl_flags |= O_NONBLOCK;
else
- {
-#ifdef O_NONBLOCK
- fcntl_flags &= ~O_NONBLOCK;
-#else
- fcntl_flags &= ~O_NDELAY;
-#endif
- }
+ fcntl_flags &= ~O_NONBLOCK;
if (fcntl (fd, F_SETFL, fcntl_flags) == -1)
return g_unix_set_error_from_errno (error, errno);