Commit 79919c0
authored
fix(io): correct write_all_nullptr_case and prevent FD leak in POSIX pipe setup (#1201)
- freestanding/io_buffer/output.h: fix write_all_nullptr_case to dispatch to
scatter_write_all(_bytes)_decay on the output stream (optstm), and keep
buffer_curr consistent.
- hosted/platforms/posix.h: avoid FD leaks in the POSIX pipe constructor by
wrapping FDs with posix_file_factory and setting FD_CLOEXEC; transfer
ownership explicitly and keep a single assignment point.
No API changes. Success paths unchanged. Rebase-only history preserved.1 parent 77a05a2 commit 79919c0
2 files changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
133 | 149 | | |
134 | 150 | | |
135 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
| 1418 | + | |
1418 | 1419 | | |
1419 | 1420 | | |
| 1421 | + | |
1420 | 1422 | | |
1421 | 1423 | | |
| 1424 | + | |
1422 | 1425 | | |
1423 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1424 | 1436 | | |
1425 | | - | |
1426 | 1437 | | |
1427 | 1438 | | |
1428 | 1439 | | |
| |||
0 commit comments