weak_alias(dummy_0, __release_ptc);
pid_t __vfork(void);
+void __testcancel(void);
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);
__acquire_ptc();
pid = __vfork();
- __release_ptc();
+
+ if (pid) __release_ptc();
if (pid > 0) {
sigset_t new = old;