]> code.delx.au - pulseaudio/blobdiff - src/pulse/context.c
Apply #ifdefs around functionality not available on win32
[pulseaudio] / src / pulse / context.c
index ca816507ab7d592d10c6abd6e941ac2c9685ba48..8f632b5d84ebdbc52c19f9a77c5044b86020adee 100644 (file)
@@ -585,10 +585,12 @@ static char *get_old_legacy_runtime_dir(void) {
         return NULL;
     }
 
+#ifdef HAVE_GETUID
     if (st.st_uid != getuid()) {
         pa_xfree(p);
         return NULL;
     }
+#endif
 
     return p;
 }
@@ -607,10 +609,12 @@ static char *get_very_old_legacy_runtime_dir(void) {
         return NULL;
     }
 
+#ifdef HAVE_GETUID
     if (st.st_uid != getuid()) {
         pa_xfree(p);
         return NULL;
     }
+#endif
 
     return p;
 }
@@ -997,6 +1001,7 @@ int pa_context_connect(
     /* Set up autospawning */
     if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
 
+#ifdef HAVE_GETUID
         if (getuid() == 0)
             pa_log_debug("Not doing autospawn since we are root.");
         else {
@@ -1005,6 +1010,7 @@ int pa_context_connect(
             if (api)
                 c->spawn_api = *api;
         }
+#endif
     }
 
     pa_context_set_state(c, PA_CONTEXT_CONNECTING);