attached patch is an alternative solution for the nolisten handling 
of aliases.
It takes the aliases from a list explicitely thus allowing a finer
control than by checking for the equality of the interface specific
functions.

Any opinions?

Egbert.

Index: Xtrans.c
===================================================================
RCS file: /home/eich/XFree86/devel/xc/lib/xtrans/Xtrans.c,v
retrieving revision 3.32
diff -u -r3.32 Xtrans.c
--- Xtrans.c    24 Jul 2003 13:50:18 -0000      3.32
+++ Xtrans.c    7 Aug 2003 14:35:40 -0000
@@ -26,7 +26,7 @@
 from The Open Group.
 
 */
-/* $XFree86: xc/lib/xtrans/Xtrans.c,v 3.31 2003/07/20 16:12:15 tsi Exp $ */
+/* $XFree86: xc/lib/xtrans/Xtrans.c,v 3.32 2003/07/24 13:50:18 eich Exp $ */
 
 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
@@ -779,6 +779,7 @@
        
 {
    Xtransport *trans;
+   int i = 0, ret = 0;
    
    if ((trans = TRANS(SelectTransport)(protocol)) == NULL) 
    {
@@ -787,9 +788,16 @@
 
        return -1;
    }
-   
+   if (trans->flags & TRANS_ALIAS) {
+       if (trans->nolisten)
+          while (trans->nolisten[i]) {
+              ret |= TRANS(NoListen)(trans->nolisten[i]);
+              i++;
+       }
+   }
+
    trans->flags |= TRANS_NOLISTEN;
-   return 0;
+   return ret;
 }
 
 int
Index: Xtransint.h
===================================================================
RCS file: /home/eich/XFree86/devel/xc/lib/xtrans/Xtransint.h,v
retrieving revision 3.37
diff -u -r3.37 Xtransint.h
--- Xtransint.h 4 Aug 2003 10:32:21 -0000       3.37
+++ Xtransint.h 7 Aug 2003 14:45:50 -0000
@@ -26,7 +26,7 @@
 from The Open Group.
 
 */
-/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.36 2003/07/24 13:50:19 eich Exp $ */
+/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.37 2003/08/04 10:32:21 eich Exp $ */
 
 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
@@ -226,7 +226,7 @@
 #endif /* TRANS_CLIENT */
 
 #ifdef TRANS_SERVER
-
+    char **    nolisten;
     XtransConnInfo (*OpenCOTSServer)(
        struct _Xtransport *,   /* transport */
        char *,                 /* protocol */
Index: Xtranslcl.c
===================================================================
RCS file: /home/eich/XFree86/devel/xc/lib/xtrans/Xtranslcl.c,v
retrieving revision 3.39
diff -u -r3.39 Xtranslcl.c
--- Xtranslcl.c 26 Nov 2002 01:12:30 -0000      3.39
+++ Xtranslcl.c 7 Aug 2003 15:07:03 -0000
@@ -2495,6 +2495,21 @@
  * call to SelectTransport() in Xtrans.c.
  */
 
+#ifdef TRANS_SERVER
+static char * local_aliases[] = {
+# ifndef sun
+                                  "pts",
+# endif
+                                 "named",
+# ifndef sun
+#  ifndef SCO325
+                                 "isc",
+#  endif
+                                 "sco",
+# endif
+                                 NULL };
+#endif
+
 Xtransport     TRANS(LocalFuncs) = {
        /* Local Interface */
        "local",
@@ -2503,6 +2518,7 @@
        TRANS(LocalOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       local_aliases,
        TRANS(LocalOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2544,6 +2560,7 @@
        TRANS(LocalOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(LocalOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2585,6 +2602,7 @@
        TRANS(LocalOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(LocalOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2626,6 +2644,7 @@
        TRANS(LocalOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(LocalOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2665,6 +2684,7 @@
        TRANS(LocalOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(LocalOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
Index: Xtransos2.c
===================================================================
RCS file: /home/eich/XFree86/devel/xc/lib/xtrans/Xtransos2.c,v
retrieving revision 3.8
diff -u -r3.8 Xtransos2.c
--- Xtransos2.c 25 Mar 2003 03:38:32 -0000      3.8
+++ Xtransos2.c 7 Aug 2003 14:58:09 -0000
@@ -833,6 +833,7 @@
        TRANS(Os2OpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(Os2OpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
Index: Xtranssock.c
===================================================================
RCS file: /home/eich/XFree86/devel/xc/lib/xtrans/Xtranssock.c,v
retrieving revision 3.60
diff -u -r3.60 Xtranssock.c
--- Xtranssock.c        24 Jul 2003 13:50:19 -0000      3.60
+++ Xtranssock.c        7 Aug 2003 14:50:46 -0000
@@ -27,7 +27,7 @@
 from the copyright holders.
 
 */
-/* $XFree86: xc/lib/xtrans/Xtranssock.c,v 3.59 2003/07/18 15:39:48 tsi Exp $ */
+/* $XFree86: xc/lib/xtrans/Xtranssock.c,v 3.60 2003/07/24 13:50:19 eich Exp $ */
 
 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
@@ -2131,6 +2131,10 @@
 
 
 #ifdef TCPCONN
+# ifdef TRANS_SERVER
+static char* tcp_nolisten[] = { "inet", "inet6", NULL };
+# endif
+
 Xtransport     TRANS(SocketTCPFuncs) = {
        /* Socket Interface */
        "tcp",
@@ -2139,6 +2143,7 @@
        TRANS(SocketOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       tcp_nolisten,
        TRANS(SocketOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2178,6 +2183,7 @@
        TRANS(SocketOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(SocketOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2218,6 +2224,7 @@
        TRANS(SocketOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(SocketOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2261,6 +2268,7 @@
        TRANS(SocketOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(SocketOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -2292,7 +2300,12 @@
        TRANS(SocketUNIXCloseForCloning),
        };
 #endif /* !LOCALCONN */
-
+# ifdef TRANS_SERVER
+#  if !defined(LOCALCONN)
+static char* unix_nolisten[] = { "local" , NULL };
+#  endif
+# endif
+           
 Xtransport     TRANS(SocketUNIXFuncs) = {
        /* Socket Interface */
        "unix",
@@ -2305,6 +2318,11 @@
        TRANS(SocketOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+#if !defined(LOCALCONN)
+       unix_nolisten,
+#else
+       NULL,
+#endif
        TRANS(SocketOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
Index: Xtranstli.c
===================================================================
RCS file: /home/eich/XFree86/devel/xc/lib/xtrans/Xtranstli.c,v
retrieving revision 3.11
diff -u -r3.11 Xtranstli.c
--- Xtranstli.c 15 Dec 2002 01:28:33 -0000      3.11
+++ Xtranstli.c 7 Aug 2003 15:00:46 -0000
@@ -1306,6 +1306,7 @@
        TRANS(TLIOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(TLIOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -1337,6 +1338,9 @@
        TRANS(TLICloseForCloning),
 };
 
+#ifdef TRANS_SERVER
+static char * inet_aliases[] = { "tcp", NULL };
+#endif
 Xtransport     TRANS(TLIINETFuncs) = {
        /* TLI Interface */
        "inet",
@@ -1345,6 +1349,7 @@
        TRANS(TLIOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       inet_aliases,
        TRANS(TLIOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT
@@ -1384,6 +1389,7 @@
        TRANS(TLIOpenCOTSClient),
 #endif /* TRANS_CLIENT */
 #ifdef TRANS_SERVER
+       NULL,
        TRANS(TLIOpenCOTSServer),
 #endif /* TRANS_SERVER */
 #ifdef TRANS_CLIENT

Reply via email to