diff -r -u vnc-3.3.7-unixsrc.orig/Xvnc/programs/Xserver/hw/vnc/init.c vnc-3.3.7-unixsrc.mod/Xvnc/programs/Xserver/hw/vnc/init.c
--- vnc-3.3.7-unixsrc.orig/Xvnc/programs/Xserver/hw/vnc/init.c	Fri Feb 28 19:47:10 2003
+++ vnc-3.3.7-unixsrc.mod/Xvnc/programs/Xserver/hw/vnc/init.c	Mon Mar 17 23:06:26 2003
@@ -134,6 +134,7 @@
 
 int inetdSock = -1;
 static char inetdDisplayNumStr[10];
+static Bool displayNumberSpecified = FALSE;
 
 extern char buildtime[];
 
@@ -297,17 +298,25 @@
     }
 
     if (strcasecmp(argv[i], "-inetd") == 0) {	/* -inetd */ 
-	int n;
-	for (n = 1; n < 100; n++) {
-	    if (CheckDisplayNumber(n))
-		break;
-	}
-
-	if (n >= 100)
-	    FatalError("-inetd: couldn't find free display number");
 
-	sprintf(inetdDisplayNumStr, "%d", n);
-	display = inetdDisplayNumStr;
+        /* If a display number hasn't been found in the command line yet,
+           find a free number and use that. If a display number is found
+           among the rest of the arguments, it will be used instead of
+           the one picked here. */
+
+        if(! displayNumberSpecified) {
+            int n;
+            for (n = 1; n < 100; n++) {
+                if (CheckDisplayNumber(n))
+                    break;
+            }
+
+            if (n >= 100)
+                FatalError("-inetd: couldn't find free display number");
+
+            sprintf(inetdDisplayNumStr, "%d", n);
+            display = inetdDisplayNumStr;
+        }
 
 	/* fds 0, 1 and 2 (stdin, out and err) are all the same socket to the
            RFB client.  OsInit() closes stdout and stdin, and we don't want
@@ -322,8 +331,8 @@
 	return 1;
     }
 
-    if (inetdSock != -1 && argv[i][0] == ':') {
-	FatalError("can't specify both -inetd and :displaynumber");
+    if (argv[i][0] == ':') {
+	displayNumberSpecified = TRUE;
     }
 
     return 0;
