1 diff -ur slim-1.3.1.orig/app.cpp slim-1.3.1/app.cpp
2 --- slim-1.3.1.orig/app.cpp 2008-09-26 02:54:15.000000000 +0200
3 +++ slim-1.3.1/app.cpp 2008-11-21 20:38:48.000000000 +0100
8 +int xioerror(Display *disp) {
9 + LoginApp->RestartServer();
13 void CatchSignal(int sig) {
14 cerr << APPNAME << ": unexpected signal " << sig << endl;
15 LoginApp->StopServer();
21 -void AlarmSignal(int sig) {
22 - int pid = LoginApp->GetServerPID();
23 - if(waitpid(pid, NULL, WNOHANG) == pid) {
24 - LoginApp->StopServer();
25 - LoginApp->RemoveLock();
28 - signal(sig, AlarmSignal);
33 void User1Signal(int sig) {
34 signal(sig, User1Signal);
37 signal(SIGHUP, CatchSignal);
38 signal(SIGPIPE, CatchSignal);
39 signal(SIGUSR1, User1Signal);
40 - signal(SIGALRM, AlarmSignal);
56 + if (wpid == ServerPID)
57 + xioerror(Dpy); // Server died, simulate IO error
59 if (WIFEXITED(status) && WEXITSTATUS(status)) {
60 LoginPanel->Message("Failed to execute login command");
85 + while (waitpid(-1, NULL, WNOHANG) > 0); // Collects all dead childrens
91 for(cycles = 0; cycles < ncycles; cycles++) {
92 if((Dpy = XOpenDisplay(DisplayName))) {
93 + XSetIOErrorHandler(xioerror);
96 if(!ServerTimeout(1, (char *) "X server to begin accepting connections"))
105 // Wait for server to start up
106 if(WaitForServer() == 0) {
107 @@ -948,15 +933,12 @@
110 void App::StopServer() {
111 - // Stop alars clock and ignore signals
113 signal(SIGQUIT, SIG_IGN);
114 signal(SIGINT, SIG_IGN);
115 signal(SIGHUP, SIG_IGN);
116 signal(SIGPIPE, SIG_IGN);
117 signal(SIGTERM, SIG_DFL);
118 signal(SIGKILL, SIG_DFL);
119 - signal(SIGALRM, SIG_DFL);
122 XSetIOErrorHandler(IgnoreXIO);
123 diff -ur slim-1.3.1.orig/app.h slim-1.3.1/app.h
124 --- slim-1.3.1.orig/app.h 2008-09-26 02:54:15.000000000 +0200
125 +++ slim-1.3.1/app.h 2008-11-21 20:38:48.000000000 +0100
130 + void RestartServer();
137 void KillAllClients(Bool top);
138 - void RestartServer();