Commit e8b810f
cbits: Ensure that fork pipe doesn't shadow std fds
Previously we would assume that the pipe used to communicate
errors from the child back to the parent did not shadow the standard
descriptors (stdin, stdout, and stderr). Somewhat surprisingly, this
appears to hold most platforms. However, OpenBSD appears to be a notable
exception. This lead to the failure of the `processT251` test.
Avoid relying on this assumption by `dup`ing the pipe fds until they end
up out of the standard fd range.
Closes #266.1 parent 484286a commit e8b810f
1 file changed
+36
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
104 | 130 | | |
105 | 131 | | |
106 | 132 | | |
| |||
119 | 145 | | |
120 | 146 | | |
121 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
122 | 158 | | |
123 | 159 | | |
124 | 160 | | |
| |||
0 commit comments