1 diff -aur slim-1.3.2.b/app.cpp slim-1.3.2.c/app.cpp
2 --- slim-1.3.2.b/app.cpp 2010-08-21 15:10:48.579631179 +0200
3 +++ slim-1.3.2.c/app.cpp 2010-08-21 15:11:03.946389843 +0200
8 +int xioerror(Display *disp) {
9 + LoginApp->RestartServer();
13 void CatchSignal(int sig) {
14 cerr << APPNAME << ": unexpected signal " << sig << endl;
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);
43 if (!force_nodaemon && cfg->getOption("daemon") == "yes") {
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 @@ -963,15 +948,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 -aur slim-1.3.2.b/app.h slim-1.3.2.c/app.h
124 --- slim-1.3.2.b/app.h 2010-08-21 15:10:40.499582804 +0200
125 +++ slim-1.3.2.c/app.h 2010-08-21 15:11:03.946389843 +0200
130 + void RestartServer();
137 void KillAllClients(Bool top);
138 - void RestartServer();