1 http://developer.berlios.de/patch/?func=detailpatch&patch_id=2378&group_id=2663
4 diff -aur slim-1.3.2.b/app.cpp slim-1.3.2.c/app.cpp
5 --- slim-1.3.2.b/app.cpp 2010-08-21 15:10:48.579631179 +0200
6 +++ slim-1.3.2.c/app.cpp 2010-08-21 15:11:03.946389843 +0200
11 +int xioerror(Display *disp) {
12 + LoginApp->RestartServer();
16 void CatchSignal(int sig) {
17 cerr << APPNAME << ": unexpected signal " << sig << endl;
24 -void AlarmSignal(int sig) {
25 - int pid = LoginApp->GetServerPID();
26 - if(waitpid(pid, NULL, WNOHANG) == pid) {
27 - LoginApp->StopServer();
28 - LoginApp->RemoveLock();
31 - signal(sig, AlarmSignal);
36 void User1Signal(int sig) {
37 signal(sig, User1Signal);
40 signal(SIGHUP, CatchSignal);
41 signal(SIGPIPE, CatchSignal);
42 signal(SIGUSR1, User1Signal);
43 - signal(SIGALRM, AlarmSignal);
46 if (!force_nodaemon && cfg->getOption("daemon") == "yes") {
59 + if (wpid == ServerPID)
60 + xioerror(Dpy); // Server died, simulate IO error
62 if (WIFEXITED(status) && WEXITSTATUS(status)) {
63 LoginPanel->Message("Failed to execute login command");
88 + while (waitpid(-1, NULL, WNOHANG) > 0); // Collects all dead childrens
94 for(cycles = 0; cycles < ncycles; cycles++) {
95 if((Dpy = XOpenDisplay(DisplayName))) {
96 + XSetIOErrorHandler(xioerror);
99 if(!ServerTimeout(1, (char *) "X server to begin accepting connections"))
108 // Wait for server to start up
109 if(WaitForServer() == 0) {
110 @@ -963,15 +948,12 @@
113 void App::StopServer() {
114 - // Stop alars clock and ignore signals
116 signal(SIGQUIT, SIG_IGN);
117 signal(SIGINT, SIG_IGN);
118 signal(SIGHUP, SIG_IGN);
119 signal(SIGPIPE, SIG_IGN);
120 signal(SIGTERM, SIG_DFL);
121 signal(SIGKILL, SIG_DFL);
122 - signal(SIGALRM, SIG_DFL);
125 XSetIOErrorHandler(IgnoreXIO);
126 diff -aur slim-1.3.2.b/app.h slim-1.3.2.c/app.h
127 --- slim-1.3.2.b/app.h 2010-08-21 15:10:40.499582804 +0200
128 +++ slim-1.3.2.c/app.h 2010-08-21 15:11:03.946389843 +0200
133 + void RestartServer();
140 void KillAllClients(Bool top);
141 - void RestartServer();