diff options
Diffstat (limited to 'hurd/fd-write.c')
| -rw-r--r-- | hurd/fd-write.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hurd/fd-write.c b/hurd/fd-write.c index 797880756b..2f070c5c5a 100644 --- a/hurd/fd-write.c +++ b/hurd/fd-write.c @@ -34,9 +34,13 @@ _hurd_fd_write (struct hurd_fd *fd, } err = HURD_FD_PORT_USE_CANCEL (fd, _hurd_ctty_output (port, ctty, writefd)); + if (err) + return err; - if (! err) - *nbytes = wrote; + if (__glibc_unlikely (wrote > *nbytes)) /* Sanity check for bogus server. */ + return EGRATUITOUS; - return err; + *nbytes = wrote; + + return 0; } |
