Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153541051
D18623.id52201.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
622 B
Referenced Files
None
Subscribers
None
D18623.id52201.diff
View Options
Index: sys/kern/kern_sendfile.c
===================================================================
--- sys/kern/kern_sendfile.c
+++ sys/kern/kern_sendfile.c
@@ -1007,8 +1007,15 @@
uap->nbytes, &sbytes, uap->flags, td);
fdrop(fp, td);
- if (uap->sbytes != NULL)
- copyout(&sbytes, uap->sbytes, sizeof(off_t));
+ /*
+ * Only copy out the number of bytes if fo_sendfile did not fail or
+ * failed with EAGAIN or EINTR.
+ */
+ if (error == 0 || error == EAGAIN || error == EINTR) {
+ if (uap->sbytes != NULL) {
+ error = copyout(&sbytes, uap->sbytes, sizeof(off_t));
+ }
+ }
out:
free(hdr_uio, M_IOV);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 6:44 PM (23 m, 14 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31994090
Default Alt Text
D18623.id52201.diff (622 B)
Attached To
Mode
D18623: Address the fact that errors from `copyout(9)` are not properly percolated up on failure
Attached
Detach File
Event Timeline
Log In to Comment