[pulseaudio-commits] 2 commits - src/pulsecore

Tanu Kaskinen tanuk at kemper.freedesktop.org
Thu Jul 11 04:15:55 PDT 2013


 src/pulsecore/log.c    |    6 ++++--
 src/pulsecore/module.c |    3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit d90d99bd38be330c9800d40d4054b4135c4e9eb4
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Thu Jul 11 14:14:29 2013 +0300

    log: Fix thread name printing
    
    Not all threads have a name.
    
    Thanks to Pierre Ossman for the patch.

diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 61873fa..e4f1c30 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -363,9 +363,11 @@ void pa_log_levelv_meta(
     pa_vsnprintf(text, sizeof(text), format, ap);
 
     if ((_flags & PA_LOG_PRINT_META) && file && line > 0 && func)
-        pa_snprintf(location, sizeof(location), "[%s][%s:%i %s()] ", pa_thread_get_name(pa_thread_self()), file, line, func);
+        pa_snprintf(location, sizeof(location), "[%s][%s:%i %s()] ",
+                    pa_strnull(pa_thread_get_name(pa_thread_self())), file, line, func);
     else if ((_flags & (PA_LOG_PRINT_META|PA_LOG_PRINT_FILE)) && file)
-        pa_snprintf(location, sizeof(location), "[%s] %s: ", pa_thread_get_name(pa_thread_self()), pa_path_get_filename(file));
+        pa_snprintf(location, sizeof(location), "[%s] %s: ",
+                    pa_strnull(pa_thread_get_name(pa_thread_self())), pa_path_get_filename(file));
     else
         location[0] = 0;
 

commit ada83601f04f73177ea5f8bda01f02a38ba55409
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Thu Jul 11 13:35:24 2013 +0300

    module: Fix crash in pa_module_unload_all()
    
    Previously, if there were no modules loaded when the daemon exited,
    pa_module_unload_all() would crash due to giving zero count to
    pa_xnew().
    
    Thanks to Pierre Ossman for the patch.

diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index 3960969..16582b3 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -221,6 +221,9 @@ void pa_module_unload_all(pa_core *c) {
     pa_assert(c);
     pa_assert(c->modules);
 
+    if (pa_idxset_isempty(c->modules))
+        return;
+
     /* Unload modules in reverse order by default */
     indices = pa_xnew(uint32_t, pa_idxset_size(c->modules));
     i = 0;



More information about the pulseaudio-commits mailing list