diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-08-10 02:40:16 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-08-10 02:40:16 +0200 |
commit | dac5756766be04f303bceaea49eba4f6ffc4e25e (patch) | |
tree | fd33d8ca67da580d26c370db4890fb5e7a5c8f50 /sys/src/cmd | |
parent | a07a2025dab770421992362d8f4e4acbbf776fa8 (diff) |
ratrace: fix fork/exec race with "nohang" procctl (like a debugger)
Diffstat (limited to 'sys/src/cmd')
-rw-r--r-- | sys/src/cmd/ratrace.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/src/cmd/ratrace.c b/sys/src/cmd/ratrace.c index 95c50933c..81b2437b1 100644 --- a/sys/src/cmd/ratrace.c +++ b/sys/src/cmd/ratrace.c @@ -192,6 +192,7 @@ threadmain(int argc, char **argv) if (pid < 0) sysfatal("fork failed: %r"); if(pid == 0) { + write(open(smprint("/proc/%d/ctl", getpid()), OWRITE|OCEXEC), "hang", 4); exec(cmd, args); if(cmd[0] != '/') exec(smprint("/bin/%s", cmd), args); |