summaryrefslogtreecommitdiff
path: root/term
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-10-02 15:59:20 +0000
committerMiles Bader <miles@gnu.org>1996-10-02 15:59:20 +0000
commit98e11f18b40af3c684db47613b0afdb15c6eabbc (patch)
treedbaf432096728bcc07fa16eb9ada08b578adb63d /term
parent26ff8dec935725e8830754e2137f9575b922a6d9 (diff)
(S_tioctl_tiocsig, S_tioctl_tiocucntl, S_tioctl_tiocpkt):
Hold GLOBAL_LOCK while frobbing (especially around send_signal).
Diffstat (limited to 'term')
-rw-r--r--term/ptyio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/term/ptyio.c b/term/ptyio.c
index 22c46407..16f5d08b 100644
--- a/term/ptyio.c
+++ b/term/ptyio.c
@@ -464,12 +464,17 @@ S_tioctl_tiocsig (io_t port,
if (!cred)
return EOPNOTSUPP;
+ mutex_lock (&global_lock);
+
drop_output ();
clear_queue (inputq);
clear_queue (rawq);
ptyio_notice_input_flushed ();
send_signal (sig);
+
+ mutex_unlock (&global_lock);
ports_port_deref (cred);
+
return 0;
}
@@ -484,6 +489,8 @@ S_tioctl_tiocpkt (io_t port,
if (!cred)
return EOPNOTSUPP;
+ mutex_lock (&global_lock);
+
if (!!mode == !!packet_mode)
err = 0;
else if (mode && user_ioctl_mode)
@@ -494,7 +501,10 @@ S_tioctl_tiocpkt (io_t port,
control_byte = 0;
err = 0;
}
+
+ mutex_unlock (&global_lock);
ports_port_deref (cred);
+
return err;
}
@@ -509,6 +519,8 @@ S_tioctl_tiocucntl (io_t port,
if (!cred)
return EOPNOTSUPP;
+ mutex_lock (&global_lock);
+
if (!!mode == !!user_ioctl_mode)
err = 0;
else if (mode && packet_mode)
@@ -519,7 +531,10 @@ S_tioctl_tiocucntl (io_t port,
control_byte = 0;
err = 0;
}
+
+ mutex_unlock (&global_lock);
ports_port_deref (cred);
+
return err;
}