mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56: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);
|
return g_unix_set_error_from_errno (error, errno);
|
||||||
|
|
||||||
if (nonblock)
|
if (nonblock)
|
||||||
{
|
|
||||||
#ifdef O_NONBLOCK
|
|
||||||
fcntl_flags |= O_NONBLOCK;
|
fcntl_flags |= O_NONBLOCK;
|
||||||
#else
|
|
||||||
fcntl_flags |= O_NDELAY;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
#ifdef O_NONBLOCK
|
|
||||||
fcntl_flags &= ~O_NONBLOCK;
|
fcntl_flags &= ~O_NONBLOCK;
|
||||||
#else
|
|
||||||
fcntl_flags &= ~O_NDELAY;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fcntl (fd, F_SETFL, fcntl_flags) == -1)
|
if (fcntl (fd, F_SETFL, fcntl_flags) == -1)
|
||||||
return g_unix_set_error_from_errno (error, errno);
|
return g_unix_set_error_from_errno (error, errno);
|
||||||
|
Loading…
Reference in New Issue
Block a user