diff options
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/fd-read.c | 1 | ||||
-rw-r--r-- | hurd/get-host.c | 1 | ||||
-rw-r--r-- | hurd/hurd/fd.h | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/hurd/fd-read.c b/hurd/fd-read.c index 55dbc24e93..388a4dbaf9 100644 --- a/hurd/fd-read.c +++ b/hurd/fd-read.c @@ -35,6 +35,7 @@ _hurd_fd_read (struct hurd_fd *fd, void *buf, size_t *nbytes, loff_t offset) } data = buf; + nread = *nbytes; if (err = HURD_FD_PORT_USE (fd, _hurd_ctty_input (port, ctty, readfd))) return err; diff --git a/hurd/get-host.c b/hurd/get-host.c index bebad892cf..3fe0b3ef78 100644 --- a/hurd/get-host.c +++ b/hurd/get-host.c @@ -51,6 +51,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen) } data = buf; + nread = buflen; err = __io_read (config, &data, &nread, -1, buflen); if (! err) /* Check if there is more in the file we didn't read. */ 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. */ |