1
0
Fork 0

[fg] master_pid is 0 for slave terminals, so no need to comapare with pid

This commit is contained in:
Witold Filipczyk 2024-03-07 13:47:30 +01:00
parent b102addf9f
commit 432771ac82
2 changed files with 3 additions and 1 deletions

View File

@ -77,7 +77,7 @@ sig_tstp(struct terminal *term)
block_itrm();
#if defined (SIGCONT) && defined(SIGTTOU)
if (pid == master_pid) {
if (master_pid) {
pid_t newpid = fork();
if (!newpid) {
sleep(1);

View File

@ -191,9 +191,11 @@ init_term(int fdin, int fdout)
term->fdout = fdout;
term->master = (term->fdout == get_output_handle());
#ifdef HAVE_GETPID
if (term->master) {
master_pid = getpid();
}
#endif
term->blocked = -1;