Pass GDBM_NOLOCK to gdbm
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Dec 2008 19:22:42 +0000 (20:22 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Dec 2008 19:22:42 +0000 (20:22 +0100)
gdbm still uses BSD lockf for locking which is incompatible with NFS.
Since we don't need the locking here since the db files in question
should never be accessed by more than one process since they are
per-home-dir and per-machine we can disable locking without any ill
results.

This should fix rhbz #471279.

src/modules/module-device-restore.c
src/modules/module-stream-restore.c

index 86a7881..c0cb0dc 100644 (file)
@@ -332,7 +332,7 @@ int pa__init(pa_module*m) {
     if (!fname)
         goto fail;
 
-    if (!(u->gdbm_file = gdbm_open(fname, 0, GDBM_WRCREAT, 0600, NULL))) {
+    if (!(u->gdbm_file = gdbm_open(fname, 0, GDBM_WRCREAT|GDBM_NOLOCK, 0600, NULL))) {
         pa_log("Failed to open volume database '%s': %s", fname, gdbm_strerror(gdbm_errno));
         pa_xfree(fname);
         goto fail;
index 5589700..fdf69a2 100644 (file)
@@ -741,7 +741,7 @@ int pa__init(pa_module*m) {
     if (!fname)
         goto fail;
 
-    if (!(u->gdbm_file = gdbm_open(fname, 0, GDBM_WRCREAT, 0600, NULL))) {
+    if (!(u->gdbm_file = gdbm_open(fname, 0, GDBM_WRCREAT|GDBM_NOLOCK, 0600, NULL))) {
         pa_log("Failed to open volume database '%s': %s", fname, gdbm_strerror(gdbm_errno));
         pa_xfree(fname);
         goto fail;