head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.14 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.12 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.4.0.10 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q2:1.4.0.8 pkgsrc-2011Q2-base:1.4 pkgsrc-2009Q4:1.4.0.6 pkgsrc-2009Q4-base:1.4 pkgsrc-2008Q4:1.4.0.4 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.2 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.3.0.2 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.2.0.6 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.4 pkgsrc-2008Q1:1.2.0.2 pkgsrc-2008Q1-base:1.2; locks; strict; comment @# @; 1.4 date 2008.09.16.21.57.09; author bjs; state dead; branches; next 1.3; 1.3 date 2008.07.24.01.07.31; author bjs; state Exp; branches; next 1.2; 1.2 date 2008.01.14.07.12.53; author tnn; state Exp; branches; next 1.1; 1.1 date 2008.01.14.06.50.52; author tnn; state Exp; branches; next ; desc @@ 1.4 log @Update to libX11-1.1.5: integrates the patches listed as removed as well as a number of i18n fixes. @ text @$NetBSD: patch-ah,v 1.3 2008/07/24 01:07:31 bjs Exp $ --- src/XlibInt.c.orig 2008-07-23 01:53:49.000000000 -0400 +++ src/XlibInt.c @@@@ -206,8 +206,6 @@@@ static char *_XAsyncReply( Bool discard); #endif /* !USE_XCB */ -#define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10) - /* * The following routines are internal routines used by Xlib for protocol * packet transmission and reception. @@@@ -570,24 +568,34 @@@@ _XWaitForReadable( } #endif /* !USE_XCB */ +static int sync_hazard(Display *dpy) +{ + unsigned long span = dpy->request - dpy->last_request_read; + unsigned long hazard = min((dpy->bufmax - dpy->buffer) / SIZEOF(xReq), 65535 - 10); + return span >= 65535 - hazard - 10; +} + static int _XSeqSyncFunction( register Display *dpy) { xGetInputFocusReply rep; register xReq *req; + int sent_sync = 0; LockDisplay(dpy); - if ((dpy->request - dpy->last_request_read) >= (BUFSIZE / SIZEOF(xReq))) { + if ((dpy->request - dpy->last_request_read) >= (65535 - BUFSIZE/SIZEOF(xReq))) { GetEmptyReq(GetInputFocus, req); (void) _XReply (dpy, (xReply *)&rep, 0, xTrue); + sent_sync = 1; } /* could get XID handler while waiting for reply in MT env */ - if (dpy->synchandler == _XSeqSyncFunction) { + if (dpy->synchandler == _XSeqSyncFunction && !sync_hazard(dpy)) { dpy->synchandler = dpy->savedsynchandler; dpy->flags &= ~XlibDisplayPrivSync; } UnlockDisplay(dpy); + if (sent_sync) SyncHandle(); return 0; } @@@@ -595,8 +603,7 @@@@ int _XSeqSyncFunction( void _XSetSeqSyncFunction( register Display *dpy) { - if ((dpy->request - dpy->last_request_read) >= SEQLIMIT && - !(dpy->flags & XlibDisplayPrivSync)) { + if (!(dpy->flags & XlibDisplayPrivSync) && sync_hazard(dpy)) { dpy->savedsynchandler = dpy->synchandler; dpy->synchandler = _XSeqSyncFunction; dpy->flags |= XlibDisplayPrivSync; @ 1.3 log @ Properly define XTHREAD_CFLAGS/XTHREADLIB on NetBSD: We do not want -pthread in XTHREAD_CFLAGS, as this will end up linking everything against libpthread. Thus, in keeping with our gcc specfile, define _REENTRANT in XTHREAD_CFLAGS instead. XTHREADLIB is now -pthread, not -lpthread. While here, update to head of libX11-1.1 branch in GIT (with the exception of some unicode changes which caused mkpatches to choke). changes: - IM: Respect XMODIFIERS for Thai locale (bug #15719) - Bug #15884: Remove useless sleep()'s from the connection code. - NLS: Make UTF-8 the default for Russian - ConnDis: properly cast 'addr' before accessing it as a byte array. - added error check in Xcms color file parser; closes bug #15305 - Fix missing error condition in cmsColNm.c, also. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-ah,v 1.2 2008/01/14 07:12:53 tnn Exp $ @ 1.2 log @... wrong patch, this one has the final #endif @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- src/XlibInt.c.orig 2007-07-21 10:45:39.000000000 +0200 d5 56 a60 14 @@@@ -138,8 +138,13 @@@@ xthread_t (*_Xthread_self_fn)(void) = NU #ifdef ISC #define ECHECK(err) ((errno == err) || ETEST()) #else +#ifdef __hpux +#define ECHECK(err) ((errno == err) || ETEST()) +#define SUNSYSV 1 +#else #define ECHECK(err) (errno == err) #endif +#endif #define ESET(val) errno = val #endif #endif @ 1.1 log @HP-UX is icky in that EAGAIN != EWOULDBLOCK and select(2) can return both things. Fortunately libX11 has code to handle this already. Enable it for HP-UX. @ text @d5 1 a5 1 @@@@ -138,6 +138,10 @@@@ xthread_t (*_Xthread_self_fn)(void) = NU d15 1 d17 2 @