mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-27 02:56:18 -04:00
[fg] Try to send CONT signal only from the master instance. Refs #287
This commit is contained in:
parent
9c04585e84
commit
b102addf9f
@ -73,12 +73,12 @@ static void
|
||||
sig_tstp(struct terminal *term)
|
||||
{
|
||||
#ifdef SIGSTOP
|
||||
pid_t newpid;
|
||||
pid_t pid = getpid();
|
||||
|
||||
block_itrm();
|
||||
#if defined (SIGCONT) && defined(SIGTTOU)
|
||||
newpid = fork();
|
||||
if (pid == master_pid) {
|
||||
pid_t newpid = fork();
|
||||
if (!newpid) {
|
||||
sleep(1);
|
||||
kill(pid, SIGCONT);
|
||||
@ -89,6 +89,7 @@ sig_tstp(struct terminal *term)
|
||||
* care of them when appropriate. */
|
||||
_exit(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
raise(SIGSTOP);
|
||||
#endif
|
||||
|
@ -54,6 +54,8 @@ INIT_LIST_OF(struct terminal, terminals);
|
||||
struct hash *temporary_files;
|
||||
static void check_if_no_terminal(void);
|
||||
|
||||
pid_t master_pid = 0;
|
||||
|
||||
void
|
||||
clean_temporary_files(void)
|
||||
{
|
||||
@ -188,6 +190,11 @@ init_term(int fdin, int fdout)
|
||||
term->fdin = fdin;
|
||||
term->fdout = fdout;
|
||||
term->master = (term->fdout == get_output_handle());
|
||||
|
||||
if (term->master) {
|
||||
master_pid = getpid();
|
||||
}
|
||||
|
||||
term->blocked = -1;
|
||||
|
||||
get_terminal_name(name + 9);
|
||||
|
@ -14,6 +14,7 @@ struct option;
|
||||
struct terminal_screen;
|
||||
struct terminal_interlink;
|
||||
|
||||
extern pid_t master_pid;
|
||||
|
||||
/** The terminal type, meaningful for frames (lines) drawing. */
|
||||
enum term_mode_type {
|
||||
|
Loading…
Reference in New Issue
Block a user