From: Enlightenment C. <no...@cv...> - 2006-06-03 06:38:09
|
Enlightenment CVS committal Author : xcomputerman Project : e17 Module : apps/entrance Dir : e17/apps/entrance/src/daemon Modified Files: Entranced.h ipc.c spawner.c Log Message: Detect if Entrance is launching correctly, and die instead of spiralling into an endless loop. =================================================================== RCS file: /cvs/e/e17/apps/entrance/src/daemon/Entranced.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- Entranced.h 6 May 2006 08:05:15 -0000 1.13 +++ Entranced.h 3 Jun 2006 06:36:16 -0000 1.14 @@ -38,6 +38,7 @@ gid_t gid; char *homedir; char *authfile; + unsigned char connected; } Entranced_Client; typedef struct _Entranced_Display =================================================================== RCS file: /cvs/e/e17/apps/entrance/src/daemon/ipc.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ipc.c 5 Sep 2005 12:05:57 -0000 1.7 +++ ipc.c 3 Jun 2006 06:36:16 -0000 1.8 @@ -17,6 +17,8 @@ if (!(e = (Ecore_Ipc_Event_Client_Add *) event)) return 1; + if (_display) + _display->client.connected = 1; entranced_debug("_entranced_ipc_client_add: Received event\n"); return 1; =================================================================== RCS file: /cvs/e/e17/apps/entrance/src/daemon/spawner.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- spawner.c 15 Jan 2006 11:27:18 -0000 1.29 +++ spawner.c 3 Jun 2006 06:36:16 -0000 1.30 @@ -16,7 +16,7 @@ static unsigned char is_respawning = 0; static unsigned char exev = 0; static unsigned char x_ready = 0; -Ecore_Timer *respawn_timer = NULL; +static Ecore_Timer *respawn_timer = NULL; /** * Write the entranced pid to the defined pidfile. @@ -223,6 +223,7 @@ { entranced_debug("Respawn timer reset.\n"); is_respawning = 0; + ecore_timer_del(respawn_timer); respawn_timer = NULL; return 0; } @@ -313,6 +314,15 @@ if (e->exe == d->e_exe || e->pid == ecore_exe_pid_get(d->e_exe)) { + /* Entrance GUI failed to initialize correctly */ + if (!d->client.connected) + { + syslog(LOG_CRIT, "Entrance GUI initialization failure. Aborting."); + fprintf(stderr, "Entrance has detected that the GUI is failing to launch properly.\n"); + fprintf(stderr, "Please check your installation. Aborting.\n\n"); + ecore_main_loop_quit(); + } + /* Session exited or crashed */ if (e->exited) { @@ -358,8 +368,8 @@ return 1; } + d->client.connected = 0; entranced_auth_user_remove(d); - Entranced_Spawn_Entrance(d); return 1; @@ -545,6 +555,7 @@ { free(d); syslog(LOG_CRIT, "Could not start X server."); + fprintf(stderr, "Entrance could not start the X server. Please check your config.\n"); exit(1); } |