File: 0003-dirs.patch

package info (click to toggle)
lvm2 2.02.168-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,500 kB
  • ctags: 15,264
  • sloc: ansic: 142,688; sh: 22,776; python: 6,500; makefile: 2,288; ruby: 332; awk: 20; cpp: 10
file content (51 lines) | stat: -rw-r--r-- 1,939 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From b37895a4dedbc165d845214f614abc0dc7a17255 Mon Sep 17 00:00:00 2001
From: Bastian Blank <waldi@debian.org>
Date: Tue, 30 Jun 2015 11:46:07 +0200
Subject: dirs

---
 conf/example.conf.in |  2 +-
 lib/config/config.c  | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/conf/example.conf.in b/conf/example.conf.in
index b1a2a9c54..736b4bd88 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -158,7 +158,7 @@ devices {
 	# tools regenerate it. If obtain_device_list_from_udev is enabled, the
 	# list of devices is obtained from udev and any existing .cache file
 	# is removed.
-	cache_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_CACHE_SUBDIR@"
+	cache_dir = "@DEFAULT_RUN_DIR@"
 
 	# Configuration option devices/cache_file_prefix.
 	# A prefix used before the .cache file name. See devices/cache_dir.
diff --git a/lib/config/config.c b/lib/config/config.c
index 3e309510f..d5a5e3c8e 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -2344,10 +2344,8 @@ const char *get_default_devices_cache_CFG(struct cmd_context *cmd, struct profil
 
 	if (cache_dir || cache_file_prefix) {
 		if (dm_snprintf(buf, sizeof(buf),
-				"%s%s%s/%s.cache",
-				cache_dir ? "" : cmd->system_dir,
-				cache_dir ? "" : "/",
-				cache_dir ? : DEFAULT_CACHE_SUBDIR,
+				"%s/%s.cache",
+				cache_dir ? : DEFAULT_RUN_DIR,
 				cache_file_prefix ? : DEFAULT_CACHE_FILE_PREFIX) < 0) {
 			log_error("Persistent cache filename too long.");
 			return NULL;
@@ -2355,8 +2353,8 @@ const char *get_default_devices_cache_CFG(struct cmd_context *cmd, struct profil
 		return dm_pool_strdup(cmd->mem, buf);
 	}
 
-	if (dm_snprintf(buf, sizeof(buf), "%s/%s/%s.cache", cmd->system_dir,
-			DEFAULT_CACHE_SUBDIR, DEFAULT_CACHE_FILE_PREFIX) < 0) {
+	if (dm_snprintf(buf, sizeof(buf), "%s/%s.cache",
+			DEFAULT_RUN_DIR, DEFAULT_CACHE_FILE_PREFIX) < 0) {
 		log_error("Persistent cache filename too long.");
 		return NULL;
 	}