2012-08-07 Cedric Bail
* Properly warn when user try to link object from different canvas.
+
+2012-08-13 Carsten Haitzler (The Rasterman)
+
+ * Fix async fd stuff to generate new pipe after a fork (pid mismatch)
static int _fd_write = -1;
static int _fd_read = -1;
+static pid_t _fd_pid = 0;
static int _init_evas_event = 0;
_init_evas_event++;
if (_init_evas_event > 1) return _init_evas_event;
+ _fd_pid = getpid();
+
if (pipe(filedes) == -1)
{
_init_evas_event = 0;
return _init_evas_event;
}
+static void
+_evas_async_events_fork_handle(void)
+{
+ int i, count = _init_evas_event;
+
+ if (getpid() == _fd_pid) return;
+ for (i = 0; i < count; i++) evas_async_events_shutdown();
+ for (i = 0; i < count; i++) evas_async_events_init();
+}
+
#endif
EAPI int
evas_async_events_fd_get(void)
{
#ifdef BUILD_ASYNC_EVENTS
+ _evas_async_events_fork_handle();
return _fd_read;
#else
return -1;
if (_fd_read == -1) return 0;
+ _evas_async_events_fork_handle();
+
do
{
check = read(_fd_read, &ev, sizeof (Evas_Event_Async *));
if (!func) return 0;
if (_fd_write == -1) return 0;
+ _evas_async_events_fork_handle();
+
ev = calloc(1, sizeof (Evas_Event_Async));
if (!ev) return 0;