This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 99e37b600385f0aa035cc82575764ccd46964d51 (commit)
- Log -----------------------------------------------------------------
a9c8f90 log: Correct bad function implementation
-----------------------------------------------------------------------
Summary of changes:
src/daemon/daemon-conf.c | 32 +++++++++++++++-----------------
1 files changed, 15 insertions(+), 17 deletions(-)
-----------------------------------------------------------------------
commit a9c8f904b0c4a03e7bff004c103aa5910f8bea3d
Author: Vincent Becker <[email protected]>
Date: Thu Mar 24 11:35:02 2011 +0100
log: Correct bad function implementation
Replace wrong implementation of log to file in pa_daemon_conf_set_log_level
to pa_daemon_conf_set_log_target
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 2872c74..633c315 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -187,6 +187,21 @@ int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const
char *string) {
} else if (!strcmp(string, "stderr")) {
c->auto_log_target = 0;
c->log_target = PA_LOG_STDERR;
+ } else if (pa_startswith(string, "file:")) {
+ char file_path[512];
+ int log_fd;
+
+ pa_strlcpy(file_path, string + 5, sizeof(file_path));
+
+ /* Open target file with user rights */
+ if ((log_fd = open(file_path, O_RDWR|O_TRUNC|O_CREAT, S_IRWXU)) >= 0) {
+ c->auto_log_target = 0;
+ c->log_target = PA_LOG_FD;
+ pa_log_set_fd(log_fd);
+ } else {
+ printf("Failed to open target file %s, error : %s\n", file_path,
pa_cstrerror(errno));
+ return -1;
+ }
} else
return -1;
@@ -213,23 +228,6 @@ int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const
char *string) {
c->log_level = PA_LOG_WARN;
else if (pa_startswith(string, "err"))
c->log_level = PA_LOG_ERROR;
- else if (pa_startswith(string, "file:")) {
- char file_path[512];
- int log_fd;
-
- pa_strlcpy(file_path, string + 5, sizeof(file_path));
-
- /* Open target file with user rights */
- if ((log_fd = open(file_path, O_RDWR|O_TRUNC|O_CREAT, S_IRWXU)) >= 0) {
- c->auto_log_target = 0;
- c->log_target = PA_LOG_FD;
- pa_log_set_fd(log_fd);
- }
- else {
- printf("Failed to open target file %s, error : %s\n", file_path,
pa_cstrerror(errno));
- return -1;
- }
- }
else
return -1;
--
hooks/post-receive
PulseAudio Sound Server
_______________________________________________
pulseaudio-commits mailing list
[email protected]
https://tango.0pointer.de/mailman/listinfo/pulseaudio-commits