[Github-comments] [geany/geany] prefer XDG_RUNTIME_DIR over /tmp for the socket (#2222)
elextr
notifications at xxxxx
Tue Jul 30 00:31:05 UTC 2019
elextr requested changes on this pull request.
> @@ -439,20 +441,35 @@ static gint socket_fd_open_unix(const gchar *path)
return -1;
}
- /* fix for #1888561:
- * in case the configuration directory is located on a network file system or any other
- * file system which doesn't support sockets, we just link the socket there and create the
- * real socket in the system's tmp directory assuming it supports sockets */
- real_path = g_strdup_printf("%s%cgeany_socket.%08x",
- g_get_tmp_dir(), G_DIR_SEPARATOR, g_random_int());
+ /* Try to place the socket in XDG_RUNTIME_DIR, according to XDG Base
+ * Directory Specification, see
+ * https://specifications.freedesktop.org/basedir-spec/latest */
+ real_dir = g_build_filename(g_get_user_runtime_dir(), "geany", NULL);
+ if (g_mkdir_with_parents(real_dir, 0755) == 0)
+ {
+ basename = g_path_get_basename(path);
+ real_path = g_build_filename(real_dir, basename, NULL);
+ }
As I said in comment, this tries to create the same socket if the user runs geany with two different configs.
(geany:20745): Geany-WARNING **: 12:28:53.641: Failed to bind IPC socket (/run/user/1000/geany/geany_socket_fred9__0): 98: Address already in use
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2222#pullrequestreview-263989941
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190729/403fd45b/attachment.html>
More information about the Github-comments
mailing list