mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-20 08:56:47 -05:00
Apply #ifdefs around functionality not available on win32
And also the reverse: around some win32 specific functionality
This commit is contained in:
parent
0ac0479534
commit
bb12ff8356
20 changed files with 120 additions and 13 deletions
|
|
@ -75,11 +75,15 @@ char *pa_get_user_name(char *s, size_t l) {
|
|||
pa_assert(s);
|
||||
pa_assert(l > 0);
|
||||
|
||||
if ((p = (getuid() == 0 ? "root" : NULL)) ||
|
||||
(p = getenv("USER")) ||
|
||||
(p = getenv("LOGNAME")) ||
|
||||
(p = getenv("USERNAME")))
|
||||
{
|
||||
p = NULL;
|
||||
#ifdef HAVE_GETUID
|
||||
p = getuid() == 0 ? "root" : NULL;
|
||||
#endif
|
||||
if (!p) p = getenv("USER");
|
||||
if (!p) p = getenv("LOGNAME");
|
||||
if (!p) p = getenv("USERNAME");
|
||||
|
||||
if (p) {
|
||||
name = pa_strlcpy(s, p, l);
|
||||
} else {
|
||||
#ifdef HAVE_PWD_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue