Commit ec41d2b
committed
Fix race condition: poll proc_get_status() until process exits
The previous approach called proc_get_status() once before
proc_close(), but the process could still be running at that point,
causing the signal detection to be skipped entirely.
Now polls proc_get_status() until the process exits, then reads the
definitive signaled/termsig fields. proc_close() is called only to
free the resource.1 parent 6b2b451 commit ec41d2b
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
305 | 307 | | |
306 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
307 | 312 | | |
308 | | - | |
| 313 | + | |
309 | 314 | | |
310 | 315 | | |
311 | 316 | | |
312 | 317 | | |
313 | 318 | | |
| 319 | + | |
| 320 | + | |
314 | 321 | | |
| 322 | + | |
| 323 | + | |
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
| |||
0 commit comments