[polypaudio-commits] r906 - /trunk/src/modules/module-match.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed May 17 08:21:34 PDT 2006


Author: lennart
Date: Wed May 17 17:21:34 2006
New Revision: 906

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=906&root=polypaudio&view=rev
Log:
add proper locking when accessing the file match.table

Modified:
    trunk/src/modules/module-match.c

Modified: trunk/src/modules/module-match.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-match.c?rev=906&root=polypaudio&r1=905&r2=906&view=diff
==============================================================================
--- trunk/src/modules/module-match.c (original)
+++ trunk/src/modules/module-match.c Wed May 17 17:21:34 2006
@@ -39,6 +39,7 @@
 #include <polypcore/core-subscribe.h>
 #include <polypcore/xmalloc.h>
 #include <polypcore/sink-input.h>
+#include <polypcore/util.h>
 
 #include "module-match-symdef.h"
 
@@ -88,6 +89,8 @@
         goto finish;
     }
 
+    pa_lock_fd(fileno(f), 1);
+    
     while (!feof(f)) {
         char *d, *v;
         pa_volume_t volume;
@@ -146,8 +149,10 @@
     ret = 0;
     
 finish:
-    if (f)
+    if (f) {
+        pa_lock_fd(fileno(f), 0);
         fclose(f);
+    }
 
     if (fn)
         pa_xfree(fn);




More information about the pulseaudio-commits mailing list