comparison src/device-x.c @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 5a88923fcbfe
children 15872534500d
comparison
equal deleted inserted replaced
166:7a77eb660975 167:85ec50267440
52 Lisp_Object Vdefault_x_device; 52 Lisp_Object Vdefault_x_device;
53 53
54 /* Qdisplay in general.c */ 54 /* Qdisplay in general.c */
55 Lisp_Object Qx_error; 55 Lisp_Object Qx_error;
56 Lisp_Object Qinit_pre_x_win, Qinit_post_x_win; 56 Lisp_Object Qinit_pre_x_win, Qinit_post_x_win;
57
58 /* $B@ZJ"(B, n. Japanese ritual suicide. */
59 int x_seppuku_on_epipe;
57 60
58 /* The application class of Emacs. */ 61 /* The application class of Emacs. */
59 Lisp_Object Vx_emacs_application_class; 62 Lisp_Object Vx_emacs_application_class;
60 63
61 Lisp_Object Vx_initial_argv_list; /* #### ugh! */ 64 Lisp_Object Vx_initial_argv_list; /* #### ugh! */
648 } 651 }
649 652
650 if (d) 653 if (d)
651 enqueue_magic_eval_event (io_error_delete_device, dev); 654 enqueue_magic_eval_event (io_error_delete_device, dev);
652 655
656 /* CvE, July 16, 1996, XEmacs 19.14 */
657 /* Test for broken pipe error, which indicates X-server has gone down */
658 if (errno == EPIPE && x_seppuku_on_epipe)
659 {
660 /* Most probably X-server has gone down: Avoid infinite loop by just */
661 /* exiting */
662 /* slb: This sounds really, really dangerous to do by default, so */
663 /* I'm adding a guard to avoid doing this as default behavior */
664 stderr_out( "\n\nXEmacs exiting on broken pipe (errno %d, %s)\n",
665 errno, strerror(errno));
666 exit(errno);
667 }
668
653 return 0; 669 return 0;
654 } 670 }
655 671
656 DEFUN ("x-debug-mode", Fx_debug_mode, 1, 2, 0, /* 672 DEFUN ("x-debug-mode", Fx_debug_mode, 1, 2, 0, /*
657 With a true arg, make the connection to the X server synchronous. 673 With a true arg, make the connection to the X server synchronous.
1436 `command-line-args-left'. Perhaps `command-line-args-left' should 1452 `command-line-args-left'. Perhaps `command-line-args-left' should
1437 just reside in C. 1453 just reside in C.
1438 */ ); 1454 */ );
1439 Vx_initial_argv_list = Qnil; 1455 Vx_initial_argv_list = Qnil;
1440 1456
1457 DEFVAR_BOOL ("x-seppuku-on-epipe", &x_seppuku_on_epipe /*
1458 When non-nil terminate XEmacs immediately on SIGPIPE from the X server.
1459 XEmacs doesn't terminate properly on some systems.
1460 When this variable is non-nil, XEmacs will commit immediate suicide
1461 when it gets a sigpipe from the X Server.
1462 */ );
1463 x_seppuku_on_epipe = 0;
1464
1441 Fprovide (Qx); 1465 Fprovide (Qx);
1442 1466
1443 staticpro (&Vdefault_x_device); 1467 staticpro (&Vdefault_x_device);
1444 Vdefault_x_device = Qnil; 1468 Vdefault_x_device = Qnil;
1445 1469