[pulseaudio-discuss] [PATCH] core-util: Fix build on mingw32

David Henningsson david.henningsson at canonical.com
Wed Dec 3 03:50:36 PST 2014


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

Reported-by: Michael DePaulo <mikedep333 at gmail.com>
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 src/pulsecore/core-util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index e9843ef..bf7f3d8 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -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);
 
-- 
1.9.1



More information about the pulseaudio-discuss mailing list