g_unix_set_fd_nonblocking: New API to control file descriptor blocking state

And use it in relevant places in GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=649225
This commit is contained in:
Colin Walters
2011-05-03 09:52:10 -04:00
parent e08e70e08d
commit ed37970a04
6 changed files with 69 additions and 32 deletions

View File

@@ -4638,7 +4638,7 @@ init_unix_signal_wakeup_state_unlocked (void)
if (!g_unix_pipe_flags (unix_signal_wake_up_pipe, FD_CLOEXEC, &error))
g_error ("Cannot create UNIX signal wake up pipe: %s\n", error->message);
fcntl (unix_signal_wake_up_pipe[1], F_SETFL, O_NONBLOCK | fcntl (unix_signal_wake_up_pipe[1], F_GETFL));
g_unix_set_fd_nonblocking (unix_signal_wake_up_pipe[1], TRUE, NULL);
/* We create a helper thread that polls on the wakeup pipe indefinitely */
if (g_thread_create (unix_signal_helper_thread, NULL, FALSE, &error) == NULL)