$OpenBSD: patch-client_gdaemonfileoutputstream_c,v 1.3 2011/07/02 15:46:17 ajacoutot Exp $

https://bugzilla.gnome.org/show_bug.cgi?id=650883

--- client/gdaemonfileoutputstream.c.orig	Mon May 23 16:38:05 2011
+++ client/gdaemonfileoutputstream.c	Wed Jun 15 08:20:17 2011
@@ -297,6 +297,16 @@ g_daemon_file_output_stream_new (int fd,
 {
   GDaemonFileOutputStream *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_OUTPUT_STREAM, NULL);
 
   stream->command_stream = g_unix_output_stream_new (fd, FALSE);
