summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorJohn Shahid <jvshahid@gmail.com>2018-09-21 11:15:10 -0400
committerEli Zaretskii <eliz@gnu.org>2018-09-29 09:30:01 +0300
commite8a4d942dd7305b85850603c97d987e52510a726 (patch)
tree0dd2b34be970a561941680a370d98b546b63df51 /src/terminal.c
parent9ad0f1d15c06eb07dfbd9bd3e3b8a0d747942152 (diff)
downloademacs-e8a4d942dd7305b85850603c97d987e52510a726.tar.gz
Cleanup when opening a new terminal fails. (Bug#32794)
* src/term.c (init_tty): Call delete_terminal_internal if emacs_open fail. * src/terminal.c (delete_terminal): Move some code into delete_terminal_internal and call it. (delete_terminal_internal): New function. * src/termhooks.h: Prototype for delete_terminal_internal.
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 070b8aac1fe..043ee67e0c1 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -314,7 +314,6 @@ create_terminal (enum output_method type, struct redisplay_interface *rif)
void
delete_terminal (struct terminal *terminal)
{
- struct terminal **tp;
Lisp_Object tail, frame;
/* Protect against recursive calls. delete_frame calls the
@@ -335,6 +334,14 @@ delete_terminal (struct terminal *terminal)
}
}
+ delete_terminal_internal (terminal);
+}
+
+void
+delete_terminal_internal (struct terminal *terminal)
+{
+ struct terminal **tp;
+
for (tp = &terminal_list; *tp != terminal; tp = &(*tp)->next_terminal)
if (! *tp)
emacs_abort ();