mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
save and restore errno in log functions
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2323 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b93ea1840c
commit
5816871117
1 changed files with 7 additions and 1 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
#include <syslog.h>
|
||||
|
|
@ -109,6 +110,7 @@ void pa_log_levelv_meta(
|
|||
|
||||
const char *e;
|
||||
char *text, *t, *n, *location;
|
||||
int saved_errno = errno;
|
||||
|
||||
pa_assert(level < PA_LOG_LEVEL_MAX);
|
||||
pa_assert(format);
|
||||
|
|
@ -116,8 +118,10 @@ void pa_log_levelv_meta(
|
|||
if ((e = getenv(ENV_LOGLEVEL)))
|
||||
maximal_level = atoi(e);
|
||||
|
||||
if (level > maximal_level)
|
||||
if (level > maximal_level) {
|
||||
errno = saved_errno;
|
||||
return;
|
||||
}
|
||||
|
||||
text = pa_vsprintf_malloc(format, ap);
|
||||
|
||||
|
|
@ -206,6 +210,8 @@ void pa_log_levelv_meta(
|
|||
|
||||
pa_xfree(text);
|
||||
pa_xfree(location);
|
||||
|
||||
errno = saved_errno;
|
||||
}
|
||||
|
||||
void pa_log_level_meta(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue