1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00

rootwrap: work around missing MSG_NOSIGNAL on old BSD derivatives

This commit is contained in:
Rémi Denis-Courmont 2015-05-21 20:51:59 +03:00
parent 499145b80d
commit 2193b044d6
2 changed files with 9 additions and 1 deletions

View File

@ -44,10 +44,12 @@
# warning Uho, your IPv6 support is broken and has been disabled. Fix your C library.
# undef AF_INET6
#endif
#ifndef AF_LOCAL
# define AF_LOCAL AF_UNIX
#endif
#if !defined(MSG_NOSIGNAL) && defined(SO_NOSIGPIPE)
# define MSG_NOSIGNAL 0
#endif
/* Required yet non-standard cmsg functions */
#ifndef CMSG_ALIGN
# define CMSG_ALIGN(len) (((len) + sizeof(intptr_t)-1) & ~(sizeof(intptr_t)-1))

View File

@ -57,6 +57,12 @@ int rootwrap_bind (int, int, int, const struct sockaddr *, size_t);
#ifndef CMSG_LEN
# define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
#endif
#if !defined(MSG_NOSIGNAL)
/* If the other end of the pipe hangs up and MSG_NOSIGNAL is missing, the
* process will get a (likely fatal) SIGPIPE signal. Then again, the other end
* can screw us up in various ways already (e.g. not answer to deadlock). */
# define MSG_NOSIGNAL 0
#endif
#if defined(__OS2__) && !defined(ALIGN)
/* CMSG_NXTHDR requires this */