From f665960c7aa6e4ebd7e927c1697339edc0ee88ef Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 6 Apr 2014 05:32:00 -0700 Subject: XQuartz: Ensure we wait for the server thread to terminate AKA: XQuartz 2.7.5 doesn't delete its /tmp/.X$d-lock http://xquartz.macosforge.org/trac/ticket/823 Signed-off-by: Jeremy Huddleston Sequoia --- hw/xquartz/X11Controller.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 5445c6f3a..022e83258 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -942,9 +942,8 @@ extern char *bundle_id_prefix; /* shutdown the X server, it will exit () for us. */ DarwinSendDDXEvent(kXquartzQuit, 0); - /* In case it doesn't, exit anyway after a while. */ - remain = 10000000; - while ((remain = usleep(remain)) > 0) ; + /* In case it doesn't, exit anyway after 5s. */ + [NSThread sleepForTimeInterval:5.0]; exit(1); } -- cgit v1.2.3