Commit 55a27f5
authored
Kqueue: sendfile EINTR doesn't advance offset — data duplication (#16544)
Motivation:
BSD/macOS sendfile passes the offset by value (unlike Linux which takes
off_t*).
When interrupted (EINTR), sbytes reports how many bytes were sent before
the signal.
Modifications:
- Advance off so the next iteration resumes from where we left off, not
from the start.
Result:
Fix possible data corruption when using sendfile and EINTR is observed1 parent fa8ca6a commit 55a27f5
1 file changed
Lines changed: 6 additions & 1 deletion
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
0 commit comments