summaryrefslogtreecommitdiff
path: root/xinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'xinit.c')
-rw-r--r--xinit.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/xinit.c b/xinit.c
index 5310101..eec4a2b 100644
--- a/xinit.c
+++ b/xinit.c
@@ -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