Repository navigation
Commit 4170c8d
committed
lib: fix system() inheriting blocked SIGCHLD mask in child process
When a timeout is specified, system() blocks SIGCHLD in the parent to
use sigtimedwait(). This blocked signal mask is inherited by the forked
child, preventing the spawned shell from receiving SIGCHLD for its own
subprocesses, causing zombie processes and hung wait() calls.
Restore the original signal mask in the child before exec().
Fixes: #382
Signed-off-by: Jo-Philipp Wich <jo@mein.io>1 parent 591d1f6 commit 4170c8d
2 files changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4042 | 4042 | | |
4043 | 4043 | | |
4044 | 4044 | | |
4045 | | - | |
| 4045 | + | |
| 4046 | + | |
| 4047 | + | |
4046 | 4048 | | |
4047 | 4049 | | |
4048 | 4050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
0 commit comments