interrupted, stop ourself with a SIGSTOP signal.
+2010-03-23 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/su.c, src/vipw.c, src/newgrp.c: When the child is
+ interrupted, stop ourself with a SIGSTOP signal.
+
2010-03-23 Nicolas François <nicolas.francois@centraliens.net>
* src/newgrp.c: Limit the scope of variable pid.
errno = 0;
pid = waitpid (child, &cst, WUNTRACED);
if ((pid == child) && (WIFSTOPPED (cst) != 0)) {
- /* stop when child stops */
- kill (getpid (), WSTOPSIG(cst));
+ /* The child (shell) was suspended.
+ * Suspend sg/newgrp. */
+ kill (getpid (), SIGSTOP);
/* wake child when resumed */
kill (child, SIGCONT);
}
if (((pid_t)-1 != pid) && (0 != WIFSTOPPED (status))) {
/* The child (shell) was suspended.
* Suspend su. */
- kill (getpid (), WSTOPSIG(status));
+ kill (getpid (), SIGSTOP);
/* wake child when resumed */
kill (pid, SIGCONT);
}
if ((pid != -1) && (WIFSTOPPED (status) != 0)) {
/* The child (editor) was suspended.
* Suspend vipw. */
- kill (getpid (), WSTOPSIG (status));
+ kill (getpid (), SIGSTOP);
/* wake child when resumed */
kill (pid, SIGCONT);
} else {