aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorKaroly Lorentey2004-02-20 17:51:35 +0000
committerKaroly Lorentey2004-02-20 17:51:35 +0000
commit81be1a9308fc20bcb6f843230e278057b0e6fdfe (patch)
treef468f57e7658953a9d8d4a63ca91a26f1afd52bb /src/term.c
parent823a1258f649b857a1e45c0192a31c088ae02c88 (diff)
downloademacs-81be1a9308fc20bcb6f843230e278057b0e6fdfe.tar.gz
emacs-81be1a9308fc20bcb6f843230e278057b0e6fdfe.zip
Don't delete a tty if it's the last device with frames.
src/term.c (delete_tty): Signal an error if this is the last display with live frames. Reported by Dan Nicolaescu. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-90
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index b345211b91c..e3b176c51ea 100644
--- a/src/term.c
+++ b/src/term.c
@@ -79,7 +79,6 @@ static void tty_show_cursor P_ ((struct tty_display_info *));
79static void tty_hide_cursor P_ ((struct tty_display_info *)); 79static void tty_hide_cursor P_ ((struct tty_display_info *));
80 80
81void delete_initial_display P_ ((struct display *)); 81void delete_initial_display P_ ((struct display *));
82void delete_tty P_ ((struct display *));
83void create_tty_output P_ ((struct frame *)); 82void create_tty_output P_ ((struct frame *));
84void delete_tty_output P_ ((struct frame *)); 83void delete_tty_output P_ ((struct frame *));
85 84
@@ -2868,19 +2867,31 @@ delete_tty (struct display *display)
2868 struct tty_display_info *tty; 2867 struct tty_display_info *tty;
2869 Lisp_Object tail, frame; 2868 Lisp_Object tail, frame;
2870 char *tty_name; 2869 char *tty_name;
2870 int last_display;
2871 2871
2872 if (deleting_tty) 2872 if (deleting_tty)
2873 /* We get a recursive call when we delete the last frame on this 2873 /* We get a recursive call when we delete the last frame on this
2874 display. */ 2874 display. */
2875 return; 2875 return;
2876 2876
2877 deleting_tty = 1;
2878
2879 if (display->type != output_termcap) 2877 if (display->type != output_termcap)
2880 abort (); 2878 abort ();
2881 2879
2882 tty = display->display_info.tty; 2880 tty = display->display_info.tty;
2883 2881
2882 last_display = 1;
2883 FOR_EACH_FRAME (tail, frame)
2884 {
2885 struct frame *f = XFRAME (frame);
2886 if (FRAME_LIVE_P (f) && (!FRAME_TERMCAP_P (f) || FRAME_TTY (f) != tty))
2887 {
2888 last_display = 0;
2889 break;
2890 }
2891 }
2892 if (last_display)
2893 error ("Attempt to delete the sole display with live frames");
2894
2884 if (tty == tty_list) 2895 if (tty == tty_list)
2885 tty_list = tty->next; 2896 tty_list = tty->next;
2886 else 2897 else
@@ -2897,6 +2908,8 @@ delete_tty (struct display *display)
2897 tty->next = 0; 2908 tty->next = 0;
2898 } 2909 }
2899 2910
2911 deleting_tty = 1;
2912
2900 FOR_EACH_FRAME (tail, frame) 2913 FOR_EACH_FRAME (tail, frame)
2901 { 2914 {
2902 struct frame *f = XFRAME (frame); 2915 struct frame *f = XFRAME (frame);