X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fprocess%2Fsystem.c;h=0cc8b8102d54519d52078c76276d1490bd116663;hb=a7936f61b23100ac32f51776c5b3e52452c7598c;hp=c8f260083ecb827a0c24dcdf5fe693e9485cb4e8;hpb=44eb4d8b9b7b3b539bcd4e311e9d7c8e2acf8d80;p=musl diff --git a/src/process/system.c b/src/process/system.c index c8f26008..0cc8b810 100644 --- a/src/process/system.c +++ b/src/process/system.c @@ -13,6 +13,7 @@ weak_alias(dummy_0, __acquire_ptc); weak_alias(dummy_0, __release_ptc); pid_t __vfork(void); +void __testcancel(void); int system(const char *cmd) { @@ -21,6 +22,8 @@ int system(const char *cmd) struct sigaction sa = { .sa_handler = SIG_IGN }, oldint, oldquit; int status = -1, i; + __testcancel(); + if (!cmd) return 1; sigaction(SIGINT, &sa, &oldint); @@ -29,7 +32,8 @@ int system(const char *cmd) __acquire_ptc(); pid = __vfork(); - __release_ptc(); + + if (pid) __release_ptc(); if (pid > 0) { sigset_t new = old;