diff options
author | Roland McGrath <roland@gnu.org> | 2008-07-02 09:53:29 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2008-07-02 09:53:29 +0000 |
commit | e66ecb226ed6991d0c39a0daf7730e65fe555c6c (patch) | |
tree | ca2f000a788dc0c929ffd79917fbd39fa56406f3 /hurd | |
parent | cc9f65ce82d4995e776464a1656587c39f6b14bb (diff) | |
download | glibc-e66ecb226ed6991d0c39a0daf7730e65fe555c6c.tar.gz |
2008-07-01 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Define MSG_NOSIGNAL.
* hurd/hurd/fd.h (__hurd_sockfail): Add extern inline function.
* sysdeps/mach/hurd/recv.c (__recv): Use __hurd_sockfail instead of
__hurd_dfail.
* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise
* sysdeps/mach/hurd/recvmsg.c (__recvmsg): Likewise
* sysdeps/mach/hurd/send.c (__send): Likewise
* sysdeps/mach/hurd/sendfrom.c (__sendfrom): Likewise
* sysdeps/mach/hurd/sendmsg.c (__sendmsg): Likewise
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/hurd/fd.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h index 08d4407e88..d1aa867cbf 100644 --- a/hurd/hurd/fd.h +++ b/hurd/hurd/fd.h @@ -27,6 +27,7 @@ #include <hurd/hurd_types.h> #include <hurd/port.h> +#include <sys/socket.h> /* Structure representing a file descriptor. */ @@ -179,6 +180,18 @@ __hurd_dfail (int fd, error_t err) errno = _hurd_fd_error (fd, err); return -1; } + +/* Likewise, but do not raise SIGPIPE on EPIPE if flags contain + MSG_NOSIGNAL. */ + +_HURD_FD_H_EXTERN_INLINE int +__hurd_sockfail (int fd, int flags, error_t err) +{ + if (!(flags & MSG_NOSIGNAL) || err != EPIPE) + err = _hurd_fd_error (fd, err); + errno = err; + return -1; +} /* Set up *FD to have PORT its server port, doing appropriate ctty magic. Does no locking or unlocking. */ |