openbsd-ports/x11/gnome/gvfs/patches/patch-client_gdaemonfileinputstream_c
2011-07-02 15:46:17 +00:00

24 lines
805 B
Plaintext

$OpenBSD: patch-client_gdaemonfileinputstream_c,v 1.3 2011/07/02 15:46:17 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=650883
--- client/gdaemonfileinputstream.c.orig Mon May 23 16:38:05 2011
+++ client/gdaemonfileinputstream.c Wed Jun 15 08:20:07 2011
@@ -376,6 +376,16 @@ g_daemon_file_input_stream_new (int fd,
{
GDaemonFileInputStream *stream;
+/*
+ * Prevent EINTR caused by OpenBSD userland threads setting all file
+ * descriptors to non-blocking mode
+ */
+#ifdef __OpenBSD__
+ int flags = fcntl(fd, F_GETFL);
+ if (fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) < 0)
+ g_warning ("Couldn't remove non-blocking I/O from fd %d", fd);
+#endif
+
stream = g_object_new (G_TYPE_DAEMON_FILE_INPUT_STREAM, NULL);
stream->command_stream = g_unix_output_stream_new (fd, FALSE);