diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2013-08-04 16:12:51 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2013-08-04 16:12:51 +0200 |
commit | d84643971e24bb6802de8606eb090ea612184489 (patch) | |
tree | bc624db01ba0a7d86926a3f81dd716a8d49e8e85 /xinit.c | |
parent | cf4be58ed088a58f6f5c553f53e542f8c28b557f (diff) | |
parent | 09ab37f816d2fe9482574c825132d9b516b8e0bf (diff) |
Merge remote-tracking branch 'origin/master' into obsd
Diffstat (limited to 'xinit.c')
-rw-r--r-- | xinit.c | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -107,7 +107,7 @@ volatile int gotSignal = 0; static void Execute(char **vec); static Bool waitforserver(void); -static Bool processTimeout(int timeout, char *string); +static Bool processTimeout(int timeout, const char *string); static int startServer(char *server[]); static int startClient(char *client[]); static int ignorexio(Display *dpy); @@ -364,10 +364,10 @@ waitforserver(void) * return TRUE if we timeout waiting for pid to exit, FALSE otherwise. */ static Bool -processTimeout(int timeout, char *string) +processTimeout(int timeout, const char *string) { int i = 0, pidfound = -1; - static char *laststring; + static const char *laststring; for (;;) { if ((pidfound = waitpid(serverpid, &status, WNOHANG)) == serverpid) @@ -627,6 +627,26 @@ shutdown(void) if (processTimeout(3, "server to die")) Fatalx("X server refuses to die"); +#ifdef __sun + else { + /* Restore keyboard mode. */ + serverpid = fork(); + switch (serverpid) { + case 0: + execlp ("kbd_mode", "kbd_mode", "-a", NULL); + Fatal("Unable to run program \"%s\"", "kbd_mode"); + break; + + case 1: + Error("fork failed"); + break; + + default: + fprintf (stderr, "\r\nRestoring keyboard mode\r\n"); + processTimeout(1, "kbd_mode"); + } + } +#endif } static void |