need_libc=false
dnl Check for usual libc functions
-AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid_r memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy strdup strndup strnlen atof lldiv posix_fadvise posix_madvise uselocale vmsplice])
+AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid_r memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy strdup strndup strnlen atof lldiv posix_fadvise posix_madvise uselocale])
AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(fcntl)
+dnl Check for Linux system calls
+AC_CHECK_FUNCS([vmsplice eventfd])
+
AH_BOTTOM([#include <vlc_fixups.h>])
AC_CHECK_FUNCS(mmap, [VLC_ADD_PLUGIN([access_mmap])])
vlc_spin_destroy( &p_priv->ref_spin );
vlc_mutex_destroy( &p_priv->lock );
vlc_cond_destroy( &p_priv->wait );
- if( p_priv->pipes[1] != -1 )
+ if( p_priv->pipes[1] != -1 && p_priv->pipes[1] != p_priv->pipes[0] )
close( p_priv->pipes[1] );
if( p_priv->pipes[0] != -1 )
close( p_priv->pipes[0] );
/* This can only ever happen if someone killed us without locking: */
assert (internals->pipes[1] == -1);
+#ifdef HAVE_EVENTFD
+ if ((internals->pipes[0] = internals->pipes[1] = eventfd (0, 0)) == -1)
+#endif
if (pipe (internals->pipes))
internals->pipes[0] = internals->pipes[1] = -1;
else