1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
From: Andriy Grytsenko <andrej@rep.kiev.ua>
Date: Sun, 14 May 2017 18:35:40 +0000 (+0300)
Subject: Fix potential access violation, use runtime user dir instead of tmp dir.
X-Git-Url: https://git.lxde.org/gitweb/?p=lxde%2Fpcmanfm.git;a=commitdiff_plain;h=bc8c3d871e9ecc67c47ff002b68cf049793faf08
Fix potential access violation, use runtime user dir instead of tmp dir.
---
diff --git a/src/single-inst.c b/src/single-inst.c
index 62c37b3..aaf84ab 100644
--- a/src/single-inst.c
+++ b/src/single-inst.c
@@ -2,7 +2,7 @@
* single-inst.c: simple IPC mechanism for single instance app
*
* Copyright 2010 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
- * Copyright 2012 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
+ * Copyright 2012-2017 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -404,11 +404,16 @@ static void get_socket_name(SingleInstData* data, char* buf, int len)
}
else
dpynum = 0;
+#if GLIB_CHECK_VERSION(2, 28, 0)
+ g_snprintf(buf, len, "%s/%s-socket-%s-%d", g_get_user_runtime_dir(),
+ data->prog_name, host ? host : "", dpynum);
+#else
g_snprintf(buf, len, "%s/.%s-socket-%s-%d-%s",
g_get_tmp_dir(),
data->prog_name,
host ? host : "",
dpynum,
g_get_user_name());
+#endif
}
|