Commit 3585accf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Linux: use accept4 if available (glibc 2.10)

parent 303fbc7c
......@@ -583,7 +583,7 @@ AC_CHECK_FUNCS(fdatasync,,
])
dnl Check for non-standard system calls
AC_CHECK_FUNCS([vmsplice eventfd fstatfs])
AC_CHECK_FUNCS([vmsplice eventfd fstatfs accept4])
AH_BOTTOM([#include <vlc_fixups.h>])
......
......@@ -2517,6 +2517,10 @@ static void* httpd_HostThread( void *data )
continue;
/* */
#ifdef HAVE_ACCEPT4
fd = accept4 (fd, NULL, NULL, SOCK_CLOEXEC);
if (fd == -1 && errno == ENOSYS)
#endif
fd = accept (fd, NULL, NULL);
if (fd == -1)
continue;
......
......@@ -255,8 +255,15 @@ next_ai: /* failure */
int net_AcceptSingle (vlc_object_t *obj, int lfd)
{
int fd;
do
{
#ifdef HAVE_ACCEPT4
fd = accept4 (lfd, NULL, NULL, SOCK_CLOEXEC);
if (fd == -1 && errno == ENOSYS)
#endif
fd = accept (lfd, NULL, NULL);
}
while (fd == -1 && errno == EINTR);
if (fd == -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment