summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/database-gdbm.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2009-06-29 18:35:06 +0300
committerTanu Kaskinen <tanuk@iki.fi>2009-06-29 18:35:06 +0300
commit0bc538b08ca5c4efea86700cb6c4685da3f34345 (patch)
treee5b0fe4b967ecb7e9251faf21904bbbe825aaab7 /src/pulsecore/database-gdbm.c
parentb152f3a052eca7225870a7dc4d8a719bee107f0f (diff)
parent2654eb7781ddcfe53064745bbad77bffe5c8eada (diff)
Merge branch 'master' into dbus-work
Conflicts: src/daemon/daemon-conf.c src/daemon/daemon-conf.h src/daemon/main.c src/pulsecore/dbus-util.h
Diffstat (limited to 'src/pulsecore/database-gdbm.c')
-rw-r--r--src/pulsecore/database-gdbm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pulsecore/database-gdbm.c b/src/pulsecore/database-gdbm.c
index aeaac64b..e65125d3 100644
--- a/src/pulsecore/database-gdbm.c
+++ b/src/pulsecore/database-gdbm.c
@@ -71,10 +71,13 @@ pa_database* pa_database_open(const char *fn, pa_bool_t for_write) {
/* We include the host identifier in the file name because gdbm
* files are CPU dependant, 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;
- f = gdbm_open((char*) path, 0, GDBM_NOLOCK | (for_write ? GDBM_WRCREAT : GDBM_READER), 0644, NULL);
+
+ /* We need to set the block size explicitly here, since otherwise
+ * gdbm takes the native block size of the underlying file system
+ * which might be incredibly large. */
+ f = gdbm_open((char*) path, 1024, GDBM_NOLOCK | (for_write ? GDBM_WRCREAT : GDBM_READER), 0644, NULL);
if (f)
pa_log_debug("Opened GDBM database '%s'", path);