[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.19-219-g430e8e2

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Oct 30 19:04:18 PDT 2009


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  2dc37e1214f20aab528ae680e9a85fc8ea143313 (commit)

- Log -----------------------------------------------------------------
430e8e2 alsa: cover 'Digital Input Source' element
3e115a9 alsa: cover Mic Jack Mode element
8e94f65 daemon: make sure pa has its own session and process group, but is not its leader so that we cannot acquire a tty ever
-----------------------------------------------------------------------

Summary of changes:
 src/daemon/main.c                                  |   40 ++++++++++----------
 .../alsa/mixer/paths/analog-input.conf.common      |   27 +++++++++++++-
 src/pulsecore/core-util.c                          |   16 ++++++++
 src/pulsecore/core-util.h                          |    2 +
 4 files changed, 64 insertions(+), 21 deletions(-)

-----------------------------------------------------------------------

commit 8e94f653489a0b3d549e61840a5cec711d466ab7
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Oct 31 02:43:47 2009 +0100

    daemon: make sure pa has its own session and process group, but is not its leader so that we cannot acquire a tty ever

diff --git a/src/daemon/main.c b/src/daemon/main.c
index c73e9af..cc6f24b 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -657,7 +657,7 @@ int main(int argc, char *argv[]) {
 
 #ifdef HAVE_FORK
         if (pipe(daemon_pipe) < 0) {
-            pa_log(_("pipe failed: %s"), pa_cstrerror(errno));
+            pa_log(_("pipe() failed: %s"), pa_cstrerror(errno));
             goto finish;
         }
 
@@ -708,22 +708,27 @@ int main(int argc, char *argv[]) {
             pa_log_set_target(PA_LOG_SYSLOG);
 
 #ifdef HAVE_SETSID
-        setsid();
-#endif
-#ifdef HAVE_SETPGID
-        setpgid(0,0);
+        if (setsid() < 0) {
+            pa_log(_("setsid() failed: %s"), pa_cstrerror(errno));
+            goto finish;
+        }
 #endif
 
-#ifndef OS_IS_WIN32
-        pa_close(0);
-        pa_close(1);
-        pa_close(2);
+        /* We now are a session and process group leader. Let's fork
+         * again and let the father die, so that we'll become a
+         * process that can never acquire a TTY again, in a session and
+         * process group without leader */
 
-        pa_assert_se(open("/dev/null", O_RDONLY) == 0);
-        pa_assert_se(open("/dev/null", O_WRONLY) == 1);
-        pa_assert_se(open("/dev/null", O_WRONLY) == 2);
-#else
-        FreeConsole();
+#ifdef HAVE_FORK
+        if ((child = fork()) < 0) {
+            pa_log(_("fork() failed: %s"), pa_cstrerror(errno));
+            goto finish;
+        }
+
+        if (child != 0) {
+            retval = 0;
+            goto finish;
+        }
 #endif
 
 #ifdef SIGTTOU
@@ -736,12 +741,7 @@ int main(int argc, char *argv[]) {
         signal(SIGTSTP, SIG_IGN);
 #endif
 
-#ifdef TIOCNOTTY
-        if ((tty_fd = open("/dev/tty", O_RDWR)) >= 0) {
-            ioctl(tty_fd, TIOCNOTTY, (char*) 0);
-            pa_assert_se(pa_close(tty_fd) == 0);
-        }
-#endif
+        pa_nullify_stdfds();
     }
 
     pa_set_env_and_record("PULSE_INTERNAL", "1");
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 738bf06..2b0a60a 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2999,3 +2999,19 @@ finish:
     pa_make_fd_cloexec(fileno(f));
     return f;
 }
+
+void pa_nullify_stdfds(void) {
+
+#ifndef OS_IS_WIN32
+        pa_close(STDIN_FILENO);
+        pa_close(STDOUT_FILENO);
+        pa_close(STDERR_FILENO);
+
+        pa_assert_se(open("/dev/null", O_RDONLY) == STDIN_FILENO);
+        pa_assert_se(open("/dev/null", O_WRONLY) == STDOUT_FILENO);
+        pa_assert_se(open("/dev/null", O_WRONLY) == STDERR_FILENO);
+#else
+        FreeConsole();
+#endif
+
+}
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index d50f79a..9c9cf78 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -265,4 +265,6 @@ int pa_pipe_cloexec(int pipefd[2]);
 int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
 FILE* pa_fopen_cloexec(const char *path, const char *mode);
 
+void pa_nullify_stdfds(void);
+
 #endif

commit 3e115a96b050bb7b74cc10aaa35c6673a6b8cc84
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Oct 31 02:49:44 2009 +0100

    alsa: cover Mic Jack Mode element
    
    As used by some HDA chips:
    
    https://bugzilla.redhat.com/attachment.cgi?id=366816

diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index 87af38b..d883b32 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -98,7 +98,7 @@ priority = 18
 name = input-docking
 priority = 17
 
-;;; ' Capture Source'
+;;; 'Capture Source'
 
 [Element Capture Source]
 enumeration = select
@@ -244,6 +244,17 @@ name = input-docking
 [Option Capture Source:Dock Mic]
 name = input-docking-microphone
 
+;;; 'Mic Jack Mode'
+
+[Element Mic Jack Mode]
+enumeration = select
+
+[Option Mic Jack Mode:Mic In]
+name = input-microphone
+
+[Option Mic Jack Mode:Line In]
+name = input-linein
+
 ;;; Various Boosts
 
 [Element Capture Boost]

commit 430e8e2ee52235f59b015e8e4a3aff9b4abd28b8
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Oct 31 02:56:57 2009 +0100

    alsa: cover 'Digital Input Source' element
    
    As used by some HDA devices:
    
    https://bugzilla.redhat.com/attachment.cgi?id=365290

diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index d883b32..007bb21 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -255,6 +255,20 @@ name = input-microphone
 [Option Mic Jack Mode:Line In]
 name = input-linein
 
+;;; 'Digital Input Source'
+
+[Element Digital Input Source]
+enumeration = select
+
+[Option Digital Input Source:Analog Inputs]
+name = input
+
+[Option Digital Input Source:Digital Mic 1]
+name = input-microphone
+
+[Option Digital Input Source:Digital Mic 2]
+name = input-microphone
+
 ;;; Various Boosts
 
 [Element Capture Boost]

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list