core-util: Fix build on mingw32

mingw32 does not have "getuid", so ifdef it properly.

Reported-by: Michael DePaulo <mikedep333@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2014-12-03 12:46:28 +01:00
parent 9793870b23
commit 686baf80d9

View file

@ -1816,6 +1816,7 @@ char *pa_get_runtime_dir(void) {
/* Use the XDG standard for the runtime directory. */
d = getenv("XDG_RUNTIME_DIR");
if (d) {
#ifdef HAVE_GETUID
struct stat st;
if (stat(d, &st) == 0 && st.st_uid != getuid()) {
pa_log(_("XDG_RUNTIME_DIR (%s) is not owned by us (uid %d), but by uid %d! "
@ -1823,6 +1824,7 @@ char *pa_get_runtime_dir(void) {
d, getuid(), st.st_uid);
goto fail;
}
#endif
k = pa_sprintf_malloc("%s" PA_PATH_SEP "pulse", d);