Do not hide the MSG_NOSIGNAL flag
Instead, filter it in libc for old networking implementations, as those do not support sending SIGPIPE to user processes anyway. This change allows newer socket drivers to implement the flag as per the specification. Change-Id: I423bdf28ca60f024a344d0a73e2eab38f1b269da
This commit is contained in:
parent
8bda47ed96
commit
53d2fa057e
@ -96,6 +96,9 @@ ssize_t sendmsg(int sock, const struct msghdr *msg, int flags)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* For old socket driver implementations, this flag is the default. */
|
||||
flags &= ~MSG_NOSIGNAL;
|
||||
|
||||
r= ioctl(sock, NWIOGUDSSOTYPE, &uds_sotype);
|
||||
if (r != -1 || errno != ENOTTY) {
|
||||
if (r == -1) {
|
||||
|
@ -66,6 +66,9 @@ ssize_t sendto(int sock, const void *message, size_t length, int flags,
|
||||
if (r != -1 || (errno != ENOTSOCK && errno != ENOSYS))
|
||||
return r;
|
||||
|
||||
/* For old socket driver implementations, this flag is the default. */
|
||||
flags &= ~MSG_NOSIGNAL;
|
||||
|
||||
r= ioctl(sock, NWIOGTCPOPT, &tcpopt);
|
||||
if (r != -1 || errno != ENOTTY)
|
||||
{
|
||||
|
@ -521,9 +521,7 @@ struct msghdr {
|
||||
#define MSG_DONTWAIT 0x0080 /* this message should be nonblocking */
|
||||
#define MSG_BCAST 0x0100 /* this message was rcvd using link-level brdcst */
|
||||
#define MSG_MCAST 0x0200 /* this message was rcvd using link-level mcast */
|
||||
#if !defined(__minix)
|
||||
#define MSG_NOSIGNAL 0x0400 /* do not generate SIGPIPE on EOF */
|
||||
#endif /* !defined(__minix) */
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define MSG_CMSG_CLOEXEC 0x0800 /* close on exec receiving fd */
|
||||
#define MSG_NBIO 0x1000 /* use non-blocking I/O */
|
||||
|
Loading…
x
Reference in New Issue
Block a user