* 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.
char const *diagnostic
= (fd < 0) ? "Could not open file: %s" : "Not a tty device: %s";
emacs_close (fd);
+ delete_terminal_internal (terminal);
maybe_fatal (must_succeed, terminal, diagnostic, diagnostic, name);
}
extern struct terminal *create_terminal (enum output_method,
struct redisplay_interface *);
extern void delete_terminal (struct terminal *);
+extern void delete_terminal_internal (struct terminal *);
extern Lisp_Object terminal_glyph_code (struct terminal *, int);
/* The initial terminal device, created by initial_term_init. */
void
delete_terminal (struct terminal *terminal)
{
- struct terminal **tp;
Lisp_Object tail, frame;
/* Protect against recursive calls. delete_frame calls the
}
}
+ 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 ();