| ... | ... | @@ -341,8 +341,11 @@ extern fn sigchld_handler(_: i32) { |
| 341 | 341 | var status: i32 = undefined; |
| 342 | 342 | const pid_result = posix.waitpid(-1, &status, posix.WNOHANG); |
| 343 | 343 | const err = posix.getErrno(pid_result); |
| 344 | | if (err == posix.ECHILD) { |
| 345 | | return; |
| 344 | if (err > 0) { |
| 345 | if (err == posix.ECHILD) { |
| 346 | return; |
| 347 | } |
| 348 | unreachable; |
| 346 | 349 | } |
| 347 | 350 | handleTerm(i32(pid_result), status); |
| 348 | 351 | } |
| ... | ... | @@ -352,12 +355,10 @@ fn handleTerm(pid: i32, status: i32) { |
| 352 | 355 | var it = children_nodes.first; |
| 353 | 356 | while (it) |node| : (it = node.next) { |
| 354 | 357 | if (node.data.pid == pid) { |
| 355 | | assert(node.data.term == null); |
| 356 | 358 | node.data.handleWaitResult(status); |
| 357 | 359 | return; |
| 358 | 360 | } |
| 359 | 361 | } |
| 360 | | unreachable; |
| 361 | 362 | } |
| 362 | 363 | |
| 363 | 364 | const sigchld_set = { |