SF.net SVN: geany: [2236] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Feb 7 17:27:10 UTC 2008


Revision: 2236
          http://geany.svn.sourceforge.net/geany/?rev=2236&view=rev
Author:   eht16
Date:     2008-02-07 09:27:05 -0800 (Thu, 07 Feb 2008)

Log Message:
-----------
Include display number for the filename of the symbolic link to the real Unix Domain Socket file (closes #1888565).      

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-02-07 15:53:02 UTC (rev 2235)
+++ trunk/ChangeLog	2008-02-07 17:27:05 UTC (rev 2236)
@@ -7,6 +7,9 @@
    Create the Unix Domain Socket for detecting a running instance in
    system's tmp directory and create a symlink to it in Geany's
    configuration directory (closes #1888561).
+ * src/socket.c:
+   Include display number for the filename of the symbolic link to the
+   real Unix Domain Socket file (closes #1888565).
 
 
 2008-02-06  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/socket.c
===================================================================
--- trunk/src/socket.c	2008-02-07 15:53:02 UTC (rev 2235)
+++ trunk/src/socket.c	2008-02-07 17:27:05 UTC (rev 2236)
@@ -183,9 +183,18 @@
 	if (sock < 0)
 		return -1;
 #else
+	gchar *display = gdk_get_display();
+	gint display_num = 0;
 
+	display = strchr(display, ':');
+	if (NZV(display))
+		display++;
+	if (NZV(display))
+		display_num = atoi(display);
+
 	if (socket_info.file_name == NULL)
-		socket_info.file_name = g_strdup_printf("%s%cgeany_socket", app->configdir, G_DIR_SEPARATOR);
+		socket_info.file_name = g_strdup_printf("%s%cgeany_socket.%d",
+			app->configdir, G_DIR_SEPARATOR, display_num);
 
 	sock = socket_fd_connect_unix(socket_info.file_name);
 	if (sock < 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