XQuartz: pbproxy shouldn't need to wait for server initialization.
Just block on the socket like every other client does. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
81493d3098
commit
8bc4727f47
|
@ -40,9 +40,6 @@ CFStringRef app_prefs_domain_cfstr;
|
||||||
|
|
||||||
/* Stubs */
|
/* Stubs */
|
||||||
char *display = NULL;
|
char *display = NULL;
|
||||||
BOOL serverRunning = YES;
|
|
||||||
pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
signal_handler(int sig)
|
signal_handler(int sig)
|
||||||
|
|
|
@ -48,22 +48,6 @@ BOOL xpbproxy_is_standalone = NO;
|
||||||
|
|
||||||
x_selection *_selection_object;
|
x_selection *_selection_object;
|
||||||
|
|
||||||
extern BOOL serverRunning;
|
|
||||||
extern pthread_mutex_t serverRunningMutex;
|
|
||||||
extern pthread_cond_t serverRunningCond;
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
wait_for_server_init(void)
|
|
||||||
{
|
|
||||||
/* If the server hasn't finished initializing, wait for it... */
|
|
||||||
if (!serverRunning) {
|
|
||||||
pthread_mutex_lock(&serverRunningMutex);
|
|
||||||
while (!serverRunning)
|
|
||||||
pthread_cond_wait(&serverRunningCond, &serverRunningMutex);
|
|
||||||
pthread_mutex_unlock(&serverRunningMutex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_io_error_handler(Display *dpy)
|
x_io_error_handler(Display *dpy)
|
||||||
{
|
{
|
||||||
|
@ -97,8 +81,6 @@ xpbproxy_run(void)
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
wait_for_server_init();
|
|
||||||
|
|
||||||
for (i = 0, xpbproxy_dpy = NULL; !xpbproxy_dpy && i < 5; i++) {
|
for (i = 0, xpbproxy_dpy = NULL; !xpbproxy_dpy && i < 5; i++) {
|
||||||
xpbproxy_dpy = XOpenDisplay(NULL);
|
xpbproxy_dpy = XOpenDisplay(NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue