]> code.delx.au - pulseaudio/commitdiff
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 86a788104544ed2ccc0d41d4deae1890486adaa6..c0cb0dc5d87c16eb6f2c114a6228ac051ae16000 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 55897004b17784c9bbac05f395a54197ce11090c..fdf69a20804bb8de96c033069de58e1a1dc68940 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;