summaryrefslogtreecommitdiff
path: root/src/pulsecore/database-gdbm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/database-gdbm.c')
-rw-r--r--src/pulsecore/database-gdbm.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/pulsecore/database-gdbm.c b/src/pulsecore/database-gdbm.c
index b1da9df9f..cd03405f5 100644
--- a/src/pulsecore/database-gdbm.c
+++ b/src/pulsecore/database-gdbm.c
@@ -59,17 +59,24 @@ void pa_datum_free(pa_datum *d) {
pa_zero(d);
}
-pa_database* pa_database_open(const char *fn, bool for_write) {
+const char* pa_database_get_arch_suffix(void) {
+ /* We include the host identifier in the file name because gdbm
+ * files are CPU dependent, and we don't want things to go wrong
+ * if we are on a multiarch system. */
+
+ return CANONICAL_HOST;
+}
+
+const char* pa_database_get_filename_suffix(void) {
+ return ".gdbm";
+}
+
+pa_database* pa_database_open_internal(const char *path, bool for_write) {
GDBM_FILE f;
int gdbm_cache_size;
- char *path;
- pa_assert(fn);
+ pa_assert(path);
- /* We include the host identifier in the file name because gdbm
- * files are CPU dependent, and we don't want things to go wrong
- * if we are on a multiarch system. */
- path = pa_sprintf_malloc("%s."CANONICAL_HOST".gdbm", fn);
errno = 0;
/* We need to set the block size explicitly here, since otherwise
@@ -80,8 +87,6 @@ pa_database* pa_database_open(const char *fn, bool for_write) {
if (f)
pa_log_debug("Opened GDBM database '%s'", path);
- pa_xfree(path);
-
if (!f) {
if (errno == 0)
errno = EIO;