diff options
author | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2013-07-11 14:14:29 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2013-07-11 14:15:33 +0300 |
commit | d90d99bd38be330c9800d40d4054b4135c4e9eb4 (patch) | |
tree | fcc7c57dead80bea11549a5f32a4ff6e6b59ccea | |
parent | ada83601f04f73177ea5f8bda01f02a38ba55409 (diff) |
log: Fix thread name printing
Not all threads have a name.
Thanks to Pierre Ossman for the patch.
-rw-r--r-- | src/pulsecore/log.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c index 61873fa48..e4f1c300f 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; |