use g_get_user_runtime_dir for claws-mail socket dir instead of g_tmp_dir
[claws.git] / src / main.c
index ff5bd38a03063f65e823d1ddc827b3efe64b691c..0de3de86f574012e359266d0a9d685c6ed20c08e 100644 (file)
@@ -2304,14 +2304,9 @@ gchar *claws_get_socket_name(void)
                GStatBuf st;
                gint stat_ok;
 
-               socket_dir = g_strdup_printf("%s%cclaws-mail-%d",
-                                          g_get_tmp_dir(), G_DIR_SEPARATOR,
-#if HAVE_GETUID
-                                          getuid());
-#else
-                                          0);
-#endif
-               stat_ok = g_stat(socket_dir, &st);
+               socket_dir = g_strdup_printf("%s%cclaws-mail",
+                                    g_get_user_runtime_dir(), G_DIR_SEPARATOR);
+        stat_ok = g_stat(socket_dir, &st);
                if (stat_ok < 0 && errno != ENOENT) {
                        g_print("Error stat'ing socket_dir %s: %s\n",
                                socket_dir, g_strerror(errno));