Commit f5e10c4
committed
cbits/fork-exec: Don't dup2 identical fds
Darwin violates POSIX by making
`dup2(x,x)`, which should be a no-op, error. Consequently, we must take
care not to `dup2` in such cases.
We had already made this change in the `posix_spawnp` codepath but I had
assumed that this *only* affected `posix_spawnp`, not the `dup2` system
call itself.1 parent 240f0c4 commit f5e10c4
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
0 commit comments