ratrace: fix fork/exec race with "nohang" procctl (like a debugger)
This commit is contained in:
parent
a07a2025da
commit
dac5756766
1 changed files with 1 additions and 0 deletions
|
@ -192,6 +192,7 @@ threadmain(int argc, char **argv)
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
sysfatal("fork failed: %r");
|
sysfatal("fork failed: %r");
|
||||||
if(pid == 0) {
|
if(pid == 0) {
|
||||||
|
write(open(smprint("/proc/%d/ctl", getpid()), OWRITE|OCEXEC), "hang", 4);
|
||||||
exec(cmd, args);
|
exec(cmd, args);
|
||||||
if(cmd[0] != '/')
|
if(cmd[0] != '/')
|
||||||
exec(smprint("/bin/%s", cmd), args);
|
exec(smprint("/bin/%s", cmd), args);
|
||||||
|
|
Loading…
Reference in a new issue