We have been using this patch at ADI for quite some time.
I was reminded to submit it by the new version of vnc recently
released.

> I just upgraded to Solaris 2.7, and am having some trouble with VNC.
> Basically, DISPLAY settings of the form "unix:1.0" or ":1.0" don't work
> with programs linked against the X11R6 libs (they work fine with the
> native openwin libs).
> 
> Have you seen this problem?
> 
> It seems that the X11R6.r4 and newer libs interpret :1.0 to mean
>   /tmp/.X11-pipe/X1
> whereas older libs used
>   /tmp/.X11-unix/X1
> 
> Vnc creates the latter but not the former.

My match makes vnc listen to .X11-pipe as well as .X11-unix.  Basically
I just copied the bits of the newer versions of X which cause those
servers to listen in both places.

Hopefully this is suitable for inclusion in the sources.  It should
make vnc's behavior a bit friendlier on Solaris.

-Vince Del Vecchio
[EMAIL PROTECTED]

--------------------

diff -ru vnc_unixsrc/Xvnc/config/cf/sun.cf vnc_unixsrc.new/Xvnc/config/cf/sun.cf
--- vnc_unixsrc/Xvnc/config/cf/sun.cf   Mon Mar  2 06:55:22 1998
+++ vnc_unixsrc.new/Xvnc/config/cf/sun.cf       Thu Nov 15 15:17:14 2001
@@ -144,6 +144,7 @@
 #define XkbServerDefines  -DXKB_ALWAYS_USES_SOFT_REPEAT
 
 #if OSMajorVersion > 4
+#define ConnectionFlags         -DTCPCONN -DUNIXCONN -DLOCALCONN
 #if HasSunC
 /* 
  * Assume /opt/SUNWspro/bin/ contains symlinks to the appropriate tools
diff -ru vnc_unixsrc/Xvnc/lib/xtrans/Xtrans.c vnc_unixsrc.new/Xvnc/lib/xtrans/Xtrans.c
--- vnc_unixsrc/Xvnc/lib/xtrans/Xtrans.c        Sat Jul 19 00:59:16 1997
+++ vnc_unixsrc.new/Xvnc/lib/xtrans/Xtrans.c    Thu Nov 15 15:35:05 2001
@@ -110,12 +110,16 @@
 #endif /* OS2PIPECONN */
 #if defined(LOCALCONN)
     &TRANS(LocalFuncs),                TRANS_LOCAL_LOCAL_INDEX,
+#ifndef sun
     &TRANS(PTSFuncs),          TRANS_LOCAL_PTS_INDEX,
+#endif /* sun */
 #ifdef SVR4
     &TRANS(NAMEDFuncs),                TRANS_LOCAL_NAMED_INDEX,
 #endif
+#ifndef sun
     &TRANS(ISCFuncs),          TRANS_LOCAL_ISC_INDEX,
     &TRANS(SCOFuncs),          TRANS_LOCAL_SCO_INDEX,
+#endif /* sun */
 #endif /* LOCALCONN */
 #if defined(AMRPCCONN) || defined(AMTCPCONN)
     &TRANS(AmConnFuncs),       TRANS_AMOEBA_INDEX,
diff -ru vnc_unixsrc/Xvnc/lib/xtrans/Xtranslcl.c 
vnc_unixsrc.new/Xvnc/lib/xtrans/Xtranslcl.c
--- vnc_unixsrc/Xvnc/lib/xtrans/Xtranslcl.c     Mon Mar  2 06:56:50 1998
+++ vnc_unixsrc.new/Xvnc/lib/xtrans/Xtranslcl.c Thu Nov 15 14:57:14 2001
@@ -18,19 +18,19 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
-Except as contained in this notice, the name of the X Consortium shall
+Except as contained in this notice, the name of The Open Group shall
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
-from the X Consortium.
+from The Open Group.
 
 */
 
-/* Copyright (c) 1993, 1994 NCR Corporation - Dayton, Ohio, USA
+/* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
  * All Rights Reserved
  *
@@ -86,6 +86,7 @@
 #endif
 #include <sys/stropts.h>
 #include <sys/wait.h>
+#include <sys/types.h>
 
 /*
  * The local transports should be treated the same as a UNIX domain socket
@@ -220,14 +221,26 @@
 {
 }
 
+#ifndef sun
 #define X_STREAMS_DIR  "/dev/X"
-#define DEV_PTMX       "/dev/ptmx"
 #define DEV_SPX                "/dev/spx"
+#else
+#ifndef X11_t
+#define X_STREAMS_DIR  "/dev/X"
+#else
+#define X_STREAMS_DIR  "/tmp/.X11-pipe"
+#endif
+#endif
+#define DEV_PTMX       "/dev/ptmx"
 
 #if defined(X11_t)
 
 #define PTSNODENAME "/dev/X/server."
+#ifndef sun
 #define NAMEDNODENAME "/dev/X/Nserver."
+#else
+#define NAMEDNODENAME "/tmp/.X11-pipe/X"
+#endif
 
 /*
  * ISC and SCO are only defined for X11 since they are there for
@@ -263,6 +276,7 @@
 
 
 
+#ifndef sun
 #ifdef TRANS_CLIENT
 
 static int
@@ -277,6 +291,7 @@
     char               *slave, namelen;
     char               buf[20]; /* MAX_PATH_LEN?? */
     PFV                        savef;
+    pid_t              saved_pid;
 
     PRMSG(2,"PTSOpenClient(%s)\n", port, 0,0 );
 
@@ -334,7 +349,7 @@
      * cannot be changed back to its original condition, hence the fork().
      */
 
-    if( !fork()) {
+    if(!(saved_pid=fork())) {
        uid_t       saved_euid;
 
        saved_euid = geteuid();
@@ -346,7 +361,7 @@
        exit( 0 );
     }
 
-    wait( &exitval );
+    waitpid(saved_pid, &exitval, 0);
 
     if (chmod(slave, 0666) < 0) {
        close(fd);
@@ -599,6 +614,7 @@
 }
 
 #endif /* TRANS_SERVER */
+#endif /* sun */
 
 
 #ifdef SVR4
@@ -820,6 +836,7 @@
 
 
 
+#ifndef sun
 /*
  * connect_spipe is used by both the SCO and ISC connection types.
  */
@@ -1370,6 +1387,7 @@
 }
 
 #endif /* TRANS_SERVER */
+#endif /* sun */
 
 
 
@@ -1602,6 +1620,7 @@
 } LOCALtrans2dev;
 
 static LOCALtrans2dev LOCALtrans2devtab[] = {
+#ifndef sun
 {"",
 #ifdef TRANS_CLIENT
      TRANS(PTSOpenClient),
@@ -1667,6 +1686,51 @@
      TRANS(PTSAccept)
 #endif /* TRANS_SERVER */
 },
+#else /* sun */
+{"",
+#ifdef TRANS_CLIENT
+     TRANS(NAMEDOpenClient),
+#endif /* TRANS_CLIENT */
+#ifdef TRANS_SERVER
+     TRANS(NAMEDOpenServer),
+#endif /* TRANS_SERVER */
+#ifdef TRANS_CLIENT
+     TRANS(OpenFail),
+#endif /* TRANS_CLIENT */
+#ifdef TRANS_SERVER
+     TRANS(OpenFail),
+#endif /* TRANS_SERVER */
+#ifdef TRANS_REOPEN
+     TRANS(NAMEDReopenServer),
+     TRANS(ReopenFail),
+#endif
+#ifdef TRANS_SERVER
+     TRANS(NAMEDAccept)
+#endif /* TRANS_SERVER */
+},
+
+{"local",
+#ifdef TRANS_CLIENT
+     TRANS(NAMEDOpenClient),
+#endif /* TRANS_CLIENT */
+#ifdef TRANS_SERVER
+     TRANS(NAMEDOpenServer),
+#endif /* TRANS_SERVER */
+#ifdef TRANS_CLIENT
+     TRANS(OpenFail),
+#endif /* TRANS_CLIENT */
+#ifdef TRANS_SERVER
+     TRANS(OpenFail),
+#endif /* TRANS_SERVER */
+#ifdef TRANS_REOPEN
+     TRANS(NAMEDReopenServer),
+     TRANS(ReopenFail),
+#endif
+#ifdef TRANS_SERVER
+     TRANS(NAMEDAccept)
+#endif /* TRANS_SERVER */
+},
+#endif /* sun */
 
 #ifdef SVR4
 {"named",
@@ -1692,6 +1756,7 @@
 },
 #endif /* SVR4 */
 
+#ifndef sun
 {"isc",
 #ifdef TRANS_CLIENT
      TRANS(ISCOpenClient),
@@ -1735,6 +1800,7 @@
      TRANS(SCOAccept)
 #endif /* TRANS_SERVER */
 },
+#endif /* sun */
 };
 
 #define NUMTRANSPORTS  (sizeof(LOCALtrans2devtab)/sizeof(LOCALtrans2dev))
@@ -1743,6 +1809,12 @@
 static char    *workingXLOCAL=NULL;
 static char    *freeXLOCAL=NULL;
 
+#ifdef sco
+#define DEF_XLOCAL "UNIX:SCO:PTS:NAMED:ISC"
+#else
+#define DEF_XLOCAL "UNIX:PTS:NAMED:ISC:SCO"
+#endif
+
 static void
 TRANS(LocalInitTransports)(protocol)
 
@@ -1760,7 +1832,7 @@
     else {
        XLOCAL=(char *)getenv("XLOCAL");
        if(XLOCAL==NULL)
-           XLOCAL="UNIX:PTS:NAMED:ISC:SCO";
+           XLOCAL=DEF_XLOCAL;
        workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (XLOCAL) + 1);
        if (workingXLOCAL)
            strcpy (workingXLOCAL, XLOCAL);
@@ -2510,6 +2582,8 @@
        TRANS(LocalCloseForCloning),
 };
 
+#ifndef sun
+
 Xtransport     TRANS(PTSFuncs) = {
        /* Local Interface */
        "pts",
@@ -2549,6 +2623,8 @@
        TRANS(LocalCloseForCloning),
 };
 
+#endif /* sun */
+
 Xtransport     TRANS(NAMEDFuncs) = {
        /* Local Interface */
        "named",
@@ -2588,6 +2664,8 @@
        TRANS(LocalCloseForCloning),
 };
 
+#ifndef sun
+
 Xtransport     TRANS(ISCFuncs) = {
        /* Local Interface */
        "isc",
@@ -2664,3 +2742,4 @@
        TRANS(LocalClose),
        TRANS(LocalCloseForCloning),
 };
+#endif /* sun */
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to