- if (__SIGTEST(proc->sig_pending, _SIGCONT)) {
- __SIGCLEAR(proc->sig_pending, _SIGSTOP);
- } else if (__SIGTEST(proc->sig_pending, _SIGSTOP)) {
+ if (!proc) {
+ return 0;
+ }
+
+ struct sighail* sh = &proc->sigctx;
+
+ if ((proc->state & PS_PAUSED)) {
+ return !!(sh->sig_pending & ~1);
+ }
+
+ if (sigset_test(sh->sig_pending, _SIGCONT)) {
+ sigset_clear(sh->sig_pending, _SIGSTOP);
+ } else if (sigset_test(sh->sig_pending, _SIGSTOP)) {