summaryrefslogtreecommitdiffstats
path: root/src/modules/module-device-restore.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-05-21 22:47:07 +0000
committerLennart Poettering <lennart@poettering.net>2008-05-21 22:47:07 +0000
commit6be0c7526cf6451d4089b5123ceae6fa3911e512 (patch)
tree1d327cedd7a10758601bb19c9a097d08eb041200 /src/modules/module-device-restore.c
parent9f86d0f543089b52ccf3e067104040b74dd22519 (diff)
move device volume file to state dir
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2479 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-device-restore.c')
-rw-r--r--src/modules/module-device-restore.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index 0a41b84a..f8f2e4ba 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -263,7 +263,7 @@ static pa_hook_result_t source_fixate_hook_callback(pa_core *c, pa_source_new_da
int pa__init(pa_module*m) {
pa_modargs *ma = NULL;
struct userdata *u;
- char *fname, *runtime_dir;
+ char *fname, *fn;
char hn[256];
pa_sink *sink;
pa_source *source;
@@ -290,11 +290,12 @@ int pa__init(pa_module*m) {
if (!pa_get_host_name(hn, sizeof(hn)))
goto fail;
- if (!(runtime_dir = pa_get_runtime_dir()))
- goto fail;
+ fn = pa_sprintf_malloc("device-volumes.%s.gdbm", hn);
+ fname = pa_state_path(fn);
+ pa_xfree(fn);
- fname = pa_sprintf_malloc("%s/device-volumes.%s.gdbm", runtime_dir, hn);
- pa_xfree(runtime_dir);
+ if (!fname)
+ goto fail;
if (!(u->gdbm_file = gdbm_open(fname, 0, GDBM_WRCREAT, 0600, NULL))) {
pa_log("Failed to open volume database '%s': %s", fname, gdbm_strerror(gdbm_errno));