summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-07-19 23:16:02 +0000
committerLennart Poettering <lennart@poettering.net>2006-07-19 23:16:02 +0000
commit703bb49c91a53d03ec55a704d895f59bfbafd8b0 (patch)
tree740cf8cc04cf4e149e4b67f2705c3ea8b4683d4e
parenta382492204ad3588c0c837e120e5bc31578df72a (diff)
add a few comments
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1110 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/daemon/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 0449cb94..cf655ee0 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -158,6 +158,10 @@ static int change_user(void) {
struct passwd *pw;
struct group * gr;
int r;
+
+ /* This function is called only in system-wide mode. It creates a
+ * runtime dir in /var/run/ with proper UID/GID and drops privs
+ * afterwards. */
if (!(pw = getpwnam(PA_SYSTEM_USER))) {
pa_log(__FILE__": Failed to find user '%s'.", PA_SYSTEM_USER);
@@ -238,8 +242,12 @@ static int change_user(void) {
static int create_runtime_dir(void) {
char fn[PATH_MAX];
-
+
pa_runtime_path(NULL, fn, sizeof(fn));
+
+ /* This function is called only when the daemon is started in
+ * per-user mode. We create the runtime directory somewhere in
+ * /tmp/ with the current UID/GID */
if (pa_make_secure_dir(fn, 0700, getuid(), getgid()) < 0) {
pa_log(__FILE__": Failed to create '%s': %s", fn, pa_cstrerror(errno));