mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
merge r2185 from prepare-0.9.10
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2201 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
78bdb978c6
commit
6734fba80c
1 changed files with 5 additions and 2 deletions
|
|
@ -65,7 +65,7 @@
|
|||
#include "util.h"
|
||||
|
||||
char *pa_get_user_name(char *s, size_t l) {
|
||||
char *p;
|
||||
const char *p;
|
||||
char buf[1024];
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
|
|
@ -75,7 +75,10 @@ char *pa_get_user_name(char *s, size_t l) {
|
|||
pa_assert(s);
|
||||
pa_assert(l > 0);
|
||||
|
||||
if (!(p = getenv("USER")) && !(p = getenv("LOGNAME")) && !(p = getenv("USERNAME"))) {
|
||||
if (!(p = (getuid() == 0 ? "root" : NULL)) &&
|
||||
!(p = getenv("USER")) &&
|
||||
!(p = getenv("LOGNAME")) &&
|
||||
!(p = getenv("USERNAME"))) {
|
||||
#ifdef HAVE_PWD_H
|
||||
|
||||
#ifdef HAVE_GETPWUID_R
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue