startx.cpp and default server (patch provided)

Jeremy C. Reed reed at reedmedia.net
Thu Apr 17 14:19:23 PDT 2008


startx.cpp has a default server (full path) like: defaultserver=XSERVER 
which defaults to ${bindir}/X at configure time.

But if no command line arguments and no ~/.xserverrc and no system 
xserverrc configuration, the server gets reset. So xinit uses its builtin 
X choice (default_server does't have full path). So the problem is the 
startx script doesn't use its builtin setting, so wrong X may be started.

I have been using the following fix for a while now and I want to commit. 
(I updated the following patch now for the recent __APPLE__ changes.)

Can someone please give this an extra set of eyes? Am I understanding this 
correctly?

diff --git a/startx.cpp b/startx.cpp
index 7e67769..9931281 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -216,17 +216,17 @@ XCOMM process server arguments
 if [ x"$server" = x ]; then
     XCOMM if no server arguments or display either, use rc file instead
     if [ x"$serverargs" = x -a x"$display" = x ]; then
 #ifdef __APPLE__
 	server=$defaultserver
 	serverargs=$defaultserverargs
 	display="$defaultdisplay"
 #else
-	server="$defaultserverargs"
+	server="$defaultserver $defaultserverargs"
 #endif
     else
 	server=$defaultserver
     fi
 fi
 
 if [ x"$enable_xauth" = x1 ] ; then
     if [ x"$XAUTHORITY" = x ]; then


Also related: shouldn't the configure script define the DEFAULT_XINIT to 
full path like it does for DEFAULT_XSERVER? (that way the correct xinit is 
used)? For now, I use --with-xinit, but I don't have to use --with-xserver 
since configure does the right thing for XSERVER.



More information about the xorg mailing list