*
* 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
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;
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");