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>
This commit is contained in:
Simon McVittie 2023-05-31 16:28:06 +01:00 committed by Philip Withnall
parent 40508b35b9
commit de6cebb5f6

View File

@ -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);