SF.net SVN: geany:[3371] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Dec 11 19:05:17 UTC 2008


Revision: 3371
          http://geany.svn.sourceforge.net/geany/?rev=3371&view=rev
Author:   eht16
Date:     2008-12-11 19:05:17 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
Update comment about using different configuration directories with multiple instance support on Windows.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/socket.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-12-11 18:54:35 UTC (rev 3370)
+++ trunk/ChangeLog	2008-12-11 19:05:17 UTC (rev 3371)
@@ -11,6 +11,9 @@
    Rename symbol list label for embedded script functions from
    'Javascript functions' to 'Functions' to avoid confusion when it
    finds symbols from other embedded languages (part of #2317001).
+ * src/socket.c:
+   Update comment about using different configuration directories with
+   multiple instance support on Windows.
 
 
 2008-12-11  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/socket.c
===================================================================
--- trunk/src/socket.c	2008-12-11 18:54:35 UTC (rev 3370)
+++ trunk/src/socket.c	2008-12-11 19:05:17 UTC (rev 3371)
@@ -195,13 +195,8 @@
 
 #ifdef G_OS_WIN32
 	HANDLE hmutex;
-	/* we need a mutex name which is unique for the used configuration dir,
-	 * but we can't use the whole path, so build a hash on the configdir and use it */
-	gchar *mutex_name = g_strdup_printf("Geany%d", g_str_hash(app->configdir));
-
 	socket_init_win32();
-	hmutex = CreateMutexA(NULL, FALSE, mutex_name);
-	g_free(mutex_name);
+	hmutex = CreateMutexA(NULL, FALSE, "Geany");
 	if (! hmutex)
 	{
 		geany_debug("cannot create Mutex\n");
@@ -209,6 +204,12 @@
 	}
 	if (GetLastError() != ERROR_ALREADY_EXISTS)
 	{
+		/* To support multiple instances with different configuration directories (as we do on
+		 * non-Windows systems) we would need to use different port number s but it might be
+		 * difficult to get a port number which is unique for a configuration directory (path)
+		 * and which is unused. This port number has to be guessed by the first and new instance
+		 * and the only data is the configuration directory path.
+		 * For now we use one port number, that is we support only one instance at all. */
 		sock = socket_fd_open_inet(REMOTE_CMD_PORT);
 		if (sock < 0)
 			return 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list