From 3d4d6d29e2209a2ca701bff2c781078a82c6b229 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 31 Aug 2005 01:24:01 +0000 Subject: [PATCH] complete fix for miniglx startup issue since driver version checks --- src/glx/mini/miniglx_events.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/glx/mini/miniglx_events.c b/src/glx/mini/miniglx_events.c index 32a2d209314..6f3f3a17947 100644 --- a/src/glx/mini/miniglx_events.c +++ b/src/glx/mini/miniglx_events.c @@ -38,7 +38,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $Id: miniglx_events.c,v 1.4 2004/07/16 04:27:00 jonsmirl Exp $ */ +/* $Id: miniglx_events.c,v 1.5 2005/08/31 01:24:01 airlied Exp $ */ #include @@ -258,6 +258,7 @@ static int welcome_message_part( Display *dpy, int i, void **msg, int sz ) if (!*msg) *msg = malloc(sz); if (!*msg) return False; if (!blocking_read( dpy, i, *msg, sz )) return False; + return sz; } else { if (!send_msg( dpy, i, &sz, sizeof(sz))) return False; @@ -283,18 +284,24 @@ static int welcome_message( Display *dpy, int i ) { void *tmp = &dpy->driverContext.shared; int *clientid = dpy->IsClient ? &dpy->clientID : &i; - + int size; + if (!welcome_message_part( dpy, i, (void **)&clientid, sizeof(*clientid))) return False; if (!welcome_message_part( dpy, i, &tmp, sizeof(dpy->driverContext.shared))) return False; - if (!welcome_message_part( dpy, i, + size=welcome_message_part( dpy, i, (void **)&dpy->driverContext.driverClientMsg, - dpy->driverContext.driverClientMsgSize )) + dpy->driverContext.driverClientMsgSize ); + + if (!size) return False; + if (dpy->IsClient) { + dpy->driverContext.driverClientMsgSize = size; + } return True; } -- 2.30.2