aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2001-04-26 00:14:14 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2001-04-26 00:14:14 +0000
commit06336fb26da5dd29f920ac2498cb09f4acbbcf59 (patch)
treec77f8e3e7e87401817dfdd9345c53893981bcbd1 /sys/kern/uipc_syscalls.c
parent9ca3a84af267097789b3d577f1059eadf1441443 (diff)
downloadsrc-06336fb26da5dd29f920ac2498cb09f4acbbcf59.tar.gz
src-06336fb26da5dd29f920ac2498cb09f4acbbcf59.zip
Sendfile is documented to return 0 on success, however if when a
sf_hdtr is used to provide writev(2) style headers/trailers on the sent data the return value is actually either the result of writev(2) from the trailers or headers of no tailers are specified. Fix sendfile to comply with the documentation, by returning 0 on success. Ok'd by: dg
Notes
Notes: svn path=/head/; revision=75989
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 33f7902916b6..74e1dc6bf1ba 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1832,6 +1832,13 @@ retry_space:
}
done:
+ /*
+ * If there was no error we have to clear p->p_retval[0]
+ * because it may have been set by writev.
+ */
+ if (error == 0) {
+ p->p_retval[0] = 0;
+ }
if (uap->sbytes != NULL) {
copyout(&sbytes, uap->sbytes, sizeof(off_t));
}