mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
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:
parent
40508b35b9
commit
de6cebb5f6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user