Updated Xserver

This commit is contained in:
pelya
2013-12-08 20:59:37 +02:00
parent ad07bc9a94
commit b209f1f02c
2 changed files with 15 additions and 21 deletions

View File

@@ -292,6 +292,7 @@ void XSDL_generateBackground(const char * port, int showHelp)
struct ifreq ifr[20];
SDL_Surface * surf;
int y = VID_Y / 3;
char msg[128];
if( !showHelp )
{
@@ -323,7 +324,6 @@ void XSDL_generateBackground(const char * port, int showHelp)
{
int addr = 0;
char saddr[32];
char msg[128];
if (ifr[i].ifr_addr.sa_family != AF_INET)
continue;
@@ -347,6 +347,13 @@ void XSDL_generateBackground(const char * port, int showHelp)
close(sd);
}
y += 10;
sprintf (msg, "To tunnel X over SSH, forward port %d", atoi(port+1) + 6000);
renderStringColor(msg, VID_X/2, y, 255, 255, 255, surf);
y += 15;
sprintf (msg, "in your SSH client", port + 6000);
renderStringColor(msg, VID_X/2, y, 255, 255, 255, surf);
SDL_SaveBMP(surf, "background.bmp");
SDL_FreeSurface(surf);
}

View File

@@ -75,26 +75,6 @@ int main( int argc, char* argv[] )
close(s);
}
// Cannot create socket with non-existing path, but Xserver code somehow does that
/*
s = socket(AF_UNIX, SOCK_STREAM, 0);
if( s >= 0 )
{
struct sockaddr_un addr;
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
sprintf(addr.sun_path, "/tmp/.X11-unix/X%d", i);
if( bind(s, (struct sockaddr *) &addr, strlen(addr.sun_path) + sizeof(addr.sun_family)) != 0 )
{
__android_log_print(ANDROID_LOG_INFO, "XSDL", "UNIX path %s already used, trying next one: %s", addr.sun_path, strerror(errno));
close(s);
continue;
}
close(s);
}
*/
FILE * ff = fopen("/proc/net/unix", "rb");
if( ff )
{
@@ -119,6 +99,13 @@ int main( int argc, char* argv[] )
break;
}
if( argc > 1 && argv[1][0] == ':')
{
strcpy(port, argv[1]);
argc--;
argv++;
}
if( argc > 1 && strcmp(argv[1], "-nohelp") == 0 )
{
printHelp = 0;