openbsd-ports/x11/gnome/gvfs/patches/patch-client_gdaemonfileinputstream_c
ajacoutot f7a8b003d0 Try to unfuck a bit glib2 functions with pthreads(3).
Remove the non-blocking flag from the fd passed to
g_daemon_file_input_stream_new(). This is needed because our userland
threads set the fd to non-blocking where g_input_stream_*() functions
are blocking operations.
This fixes the progress bar display and allows to write to remote
directories like ftp, sftp, webdav. Reading from these remote locations
is "somehow" working now too, but there is still something fishy when
copying directories.
You have been warned. However, it's much better than it was.
2010-07-24 16:04:21 +00:00

22 lines
828 B
Plaintext

$OpenBSD: patch-client_gdaemonfileinputstream_c,v 1.1 2010/07/24 16:04:21 ajacoutot Exp $
XXX Remove non-blocking flag from fd. This is needed because the
g_input_stream_*() functions are blocking but we compile with -pthread
which sets all fds to non-blocking. See pthreads(3).
--- client/gdaemonfileinputstream.c.orig Mon Oct 19 15:11:03 2009
+++ client/gdaemonfileinputstream.c Fri Jul 23 20:15:17 2010
@@ -376,6 +376,12 @@ g_daemon_file_input_stream_new (int fd,
{
GDaemonFileInputStream *stream;
+#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);