xserver: Branch 'xorg-server-1.4-apple'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sun May 18 23:31:48 PDT 2008


 hw/xquartz/darwinEvents.c |    1 -
 os/connection.c           |   35 +++++------------------------------
 2 files changed, 5 insertions(+), 31 deletions(-)

New commits:
commit 6fb587d3d5fbbaee9e46cdce24d03e5d1c66d58a
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sun May 18 23:31:41 2008 -0700

    XQuartz: Cleaned up ListenOnOpenFD...

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 9ecebe4..0ecb064 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -220,7 +220,6 @@ static void kXquartzListenOnOpenFDHandler(int screenNum, xEventPtr xe, DeviceInt
     TA_SERVER();
 
     for (i=0; i<nevents; i++) {
-        //sleep(20);
         ListenOnOpenFD(xe[i].u.clientMessage.u.l.longs0);
     }
 }
diff --git a/os/connection.c b/os/connection.c
index d34cddd..0a6e016 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1266,8 +1266,7 @@ MakeClientGrabPervious(ClientPtr client)
 /* Add a fd (from launchd) to our listeners */
 _X_EXPORT void ListenOnOpenFD(int fd) {
     char port[20];
-    XtransConnInfo ciptr, *ciptr2, *ciptr3;
-    int *iptr, *iptr2;
+    XtransConnInfo ciptr;
     
     /* Sigh for inconsistencies. */  
     sprintf (port, ":%d", atoi(display));
@@ -1277,37 +1276,13 @@ _X_EXPORT void ListenOnOpenFD(int fd) {
      */
     ciptr = _XSERVTransReopenCOTSServer(5, fd, port);
     if(ciptr == NULL) {
-        fprintf(stderr, "Got NULL while trying to Reopen launchd port.\n");
+        ErrorF("Got NULL while trying to Reopen launchd port.\n");
         return;
     }
     
     /* Allocate space to store it */
-    iptr = (int *) realloc(ListenTransFds, (ListenTransCount + 1) * sizeof (int));
-    
-    if(!iptr) {
-        fprintf(stderr, "Memory allocation error");
-        return;
-    }
-    
-    ciptr2 = (XtransConnInfo *) realloc(ListenTransConns, (ListenTransCount + 1) * sizeof (XtransConnInfo));
-    if(!ciptr2) {
-        fprintf(stderr, "Memory allocation error");
-        if(iptr != ListenTransFds)
-            free(ListenTransFds);
-        return;
-    }
-
-    if(iptr != ListenTransFds) {
-        iptr2 = ListenTransFds;
-        ListenTransFds = iptr;
-        free(iptr2);
-    }
-    
-    if(ciptr2 != ListenTransConns) {
-        ciptr3 = ListenTransConns;
-        ListenTransConns = ciptr2;
-        free(ciptr3);
-    }
+    ListenTransFds = (int *) xrealloc(ListenTransFds, (ListenTransCount + 1) * sizeof (int));
+    ListenTransConns = (XtransConnInfo *) xrealloc(ListenTransConns, (ListenTransCount + 1) * sizeof (XtransConnInfo));
     
     /* Store it */
     ListenTransConns[ListenTransCount] = ciptr;
@@ -1320,7 +1295,7 @@ _X_EXPORT void ListenOnOpenFD(int fd) {
     //    DefineSelf (fd);
     }
     */
-    
+
     /* Increment the count */
     ListenTransCount++;
 }


More information about the xorg-commit mailing list