#if defined (HAVE_SYS_EVENTFD_H)
# include <sys/eventfd.h>
+# ifndef EFD_CLOEXEC
+# define EFD_CLOEXEC 0
+# warning EFD_CLOEXEC missing. Consider updating libc.
+# endif
#endif
/* This can only ever happen if someone killed us without locking: */
assert (internals->pipes[1] == -1);
+ /* pipe() is not a cancellation point, but write() is and eventfd() is
+ * unspecified (not in POSIX). */
+ int canc = vlc_savecancel ();
#if defined (HAVE_SYS_EVENTFD_H)
- internals->pipes[0] = internals->pipes[1] = eventfd (0, 0);
+ internals->pipes[0] = internals->pipes[1] = eventfd (0, EFD_CLOEXEC);
if (internals->pipes[0] == -1)
#endif
{
msg_Dbg (obj, "waitpipe: object already dying");
write (internals->pipes[1], &(uint64_t){ 1 }, sizeof (uint64_t));
}
+ vlc_restorecancel (canc);
}
vlc_mutex_unlock (&pipe_lock);
return internals->pipes[0];
MYCASE( VARIABLE, "variable" );
MYCASE( FLOAT, "float" );
MYCASE( TIME, "time" );
+ MYCASE( COORDS, "coords" );
MYCASE( ADDRESS, "address" );
MYCASE( MUTEX, "mutex" );
MYCASE( LIST, "list" );
case VLC_VAR_TIME:
printf( ": %"PRIi64, (int64_t)p_var->val.i_time );
break;
+ case VLC_VAR_COORDS:
+ printf( ": %"PRId32"x%"PRId32,
+ p_var->val.coords.x, p_var->val.coords.y );
+ break;
case VLC_VAR_ADDRESS:
printf( ": %p", p_var->val.p_address );
break;