Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: Makefile.am e_includes.h e_main.c Added Files: e_signals.c e_signals.h Log Message: singals patch =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- Makefile.am 15 Jan 2005 09:50:13 -0000 1.12 +++ Makefile.am 27 Jan 2005 10:14:22 -0000 1.13 @@ -40,7 +40,8 @@ e_startup.h \ e_iconify.h \ e_hints.h \ -e_gadman.h +e_gadman.h \ +e_signals.h enlightenment_SOURCES = \ @@ -75,6 +76,7 @@ e_iconify.c \ e_hints.c \ e_gadman.c \ +e_signals.c \ $(ENLIGHTENMENTHEADERS) enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_includes.h 15 Jan 2005 09:50:26 -0000 1.2 +++ e_includes.h 27 Jan 2005 10:14:22 -0000 1.3 @@ -28,3 +28,4 @@ #include "e_iconify.h" #include "e_hints.h" #include "e_gadman.h" +#include "e_signals.h" =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- e_main.c 22 Jan 2005 05:21:48 -0000 1.39 +++ e_main.c 27 Jan 2005 10:14:22 -0000 1.40 @@ -19,6 +19,7 @@ static void _e_main_cb_x_fatal(void *data); static int _e_main_cb_signal_exit(void *data, int ev_type, void *ev); +static int _e_main_cb_signal_hup(void *data, int ev_type, void *ev); static int _e_main_cb_x_flusher(void *data); static int _e_main_cb_idler_before(void *data); static int _e_main_cb_idler_after(void *data); @@ -57,10 +58,17 @@ int after_restart = 0; char buf[1024]; char *s; - + /* install the signal handlers. */ + struct sigaction sigsegv_action; + struct sigaction sighup_action; + sigsegv_action.sa_sigaction=&e_sigseg_act; + sigsegv_action.sa_flags=0; + sigaction(SIGSEGV, &sigsegv_action, NULL); + + /* for debugging by redirecting stdout of e to a log file to tail */ setvbuf(stdout, NULL, _IONBF, 0); - + if (getenv("NOSPLASH")) nosplash = 1; if (getenv("NOSTARTUP")) nostartup = 1; if (getenv("NOWELCOME")) nowelcome = 1; @@ -128,6 +136,12 @@ "Perhaps you are out of memory?"); _e_main_shutdown(-1); } + if(!ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP, _e_main_cb_signal_hup, NULL)) + { + e_error_message_show("Enlightenment cannot set up a HUP signal handler.\n" + "Perhaps you are out of memory?"); + _e_main_shutdown(-1); + } /* an idle enterer to be called before all others */ _e_main_idle_enterer_before = ecore_idle_enterer_add(_e_main_cb_idler_before, NULL); @@ -785,6 +799,14 @@ ecore_main_loop_quit(); return 1; } +static int +_e_main_cb_signal_hup(void *data, int ev_type, void *ev) +{ + /* called on SIGHUP to restart Enlightenment */ + printf("RESTART ON!\n"); + restart = 1; + ecore_main_loop_quit(); +} static int _e_main_cb_x_flusher(void *data) @@ -851,3 +873,4 @@ e_init_hide(); return 0; } + ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs