]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/vlcpulse.c
fingerprinter: fix dist
[vlc] / modules / audio_output / vlcpulse.c
index a9fedcf34e177c02e19ad778a0aee05d8c612b0a..f00775ab21dbf51a9a11faba899ed96c3cd2a7e2 100644 (file)
@@ -12,7 +12,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
@@ -123,10 +123,13 @@ pa_context *vlc_pa_connect (vlc_object_t *obj, pa_threaded_mainloop **mlp)
             struct passwd pwbuf, *pw;
             char buf[len];
 
-            if (getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw) == 0
-             && pw != NULL)
-                pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_USER,
-                                  pw->pw_name);
+            if (getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw) == 0)
+            {
+                if (pw != NULL)
+                    pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_USER,
+                                      pw->pw_name);
+                break;
+            }
         }
 
         for (size_t max = sysconf (_SC_HOST_NAME_MAX), len = max % 1024 + 1024;
@@ -135,8 +138,11 @@ pa_context *vlc_pa_connect (vlc_object_t *obj, pa_threaded_mainloop **mlp)
             char hostname[len];
 
             if (gethostname (hostname, sizeof (hostname)) == 0)
+            {
                 pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_HOST,
                                   hostname);
+                break;
+            }
         }
 
         const char *session = getenv ("XDG_SESSION_COOKIE");