t* My OpenBSD ports URI git clone git://git.codevoid.de/mystuff.git DIR Log DIR Files DIR Refs --- tpatch-common_ipc_c (1088B) --- 1 $OpenBSD$ 2 3 NetBSD EOF fix 4 5 Index: common/ipc.c 6 --- common/ipc.c.orig 7 +++ common/ipc.c 8 @@ -21,6 +21,7 @@ 9 #include "common/lualib.h" 10 #include "common/luaserialize.h" 11 #include "common/ipc.h" 12 +#include "log.h" 13 14 /* Prototypes for ipc_recv_... functions */ 15 #define X(name) void ipc_recv_##name(ipc_endpoint_t *ipc, const void *msg, guint length); 16 @@ -138,6 +139,15 @@ ipc_recv_and_dispatch_or_enqueue(ipc_endpoint_t *ipc) 17 case G_IO_STATUS_AGAIN: 18 return; 19 case G_IO_STATUS_EOF: 20 + verbose("g_io_channel_read_chars(): End Of File received"); 21 + /* OSX and NetBSD are sending EOF on nonblocking channels first. 22 + * These requests can be ignored. They should end up in 23 + * recv_hup(), but unfortunately they do not. 24 + * 25 + * If we do not close the socket, glib will continue to 26 + * call the G_IO_IN handler. 27 + */ 28 + g_atomic_int_dec_and_test(&ipc->refcount); 29 return; 30 case G_IO_STATUS_ERROR: 31 if (!g_str_equal(ipc->name, "UI"))