[pulseaudio-discuss] [PATCH 2/3] log: Use pa_write() instead of write()
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Thu Jun 20 07:24:27 PDT 2013
---
src/pulsecore/log.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index f1a1876..d58477e 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -77,6 +77,7 @@ static unsigned show_backtrace = 0, show_backtrace_override = 0, skip_backtrace
static pa_log_flags_t flags = 0, flags_override = 0;
static pa_bool_t no_rate_limit = FALSE;
static int log_fd = -1;
+static int write_type = 0;
#ifdef HAVE_SYSLOG_H
static const int level_to_syslog[] = {
@@ -468,7 +469,7 @@ void pa_log_levelv_meta(
pa_snprintf(metadata, sizeof(metadata), "\n%c %s %s", level_to_char[level], timestamp, location);
- if ((write(log_fd, metadata, strlen(metadata)) < 0) || (write(log_fd, t, strlen(t)) < 0)) {
+ if ((pa_write(log_fd, metadata, strlen(metadata), &write_type) < 0) || (pa_write(log_fd, t, strlen(t), &write_type) < 0)) {
pa_log_target new_target = { .type = PA_LOG_STDERR, .file = NULL };
saved_errno = errno;
fprintf(stderr, "%s\n", "Error writing logs to a file descriptor. Redirect log messages to console.");
--
1.8.1.2
More information about the pulseaudio-discuss
mailing list