Xserver-gimp: better algorithm for finding stale Xserver sockets
This commit is contained in:
@@ -175,10 +175,10 @@ MultiABI=armeabi-v7a
|
||||
AppMinimumRAM=0
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=28203
|
||||
AppVersionCode=28204
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="2.8.2.03"
|
||||
AppVersionName="2.8.2.04"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=y
|
||||
|
||||
@@ -95,6 +95,25 @@ int main( int argc, char* argv[] )
|
||||
close(s);
|
||||
}
|
||||
*/
|
||||
FILE * ff = fopen("/proc/net/unix", "rb");
|
||||
if( ff )
|
||||
{
|
||||
char buf[512], name[512];
|
||||
int found = 0;
|
||||
sprintf(name, "/tmp/.X11-unix/X%d", i);
|
||||
while( fgets(buf, sizeof(buf), ff) )
|
||||
{
|
||||
if( strstr(buf, name) != NULL )
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "UNIX path %s already used, trying next one", name);
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(ff);
|
||||
if( found )
|
||||
continue;
|
||||
}
|
||||
|
||||
sprintf( port, ":%d", i );
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user