mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
gdbus: Improve readability by avoiding ternary operator
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
6cca256526
commit
7c0b9c776f
@ -1330,7 +1330,11 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type,
|
|||||||
switch (bus_type)
|
switch (bus_type)
|
||||||
{
|
{
|
||||||
case G_BUS_TYPE_SYSTEM:
|
case G_BUS_TYPE_SYSTEM:
|
||||||
ret = !is_setuid ? g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS")) : NULL;
|
if (is_setuid)
|
||||||
|
ret = NULL;
|
||||||
|
else
|
||||||
|
ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS"));
|
||||||
|
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket");
|
ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket");
|
||||||
@ -1338,7 +1342,11 @@ g_dbus_address_get_for_bus_sync (GBusType bus_type,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case G_BUS_TYPE_SESSION:
|
case G_BUS_TYPE_SESSION:
|
||||||
ret = !is_setuid ? g_strdup (g_getenv ("DBUS_SESSION_BUS_ADDRESS")) : NULL;
|
if (is_setuid)
|
||||||
|
ret = NULL;
|
||||||
|
else
|
||||||
|
ret = g_strdup (g_getenv ("DBUS_SESSION_BUS_ADDRESS"));
|
||||||
|
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
ret = get_session_address_platform_specific (&local_error);
|
ret = get_session_address_platform_specific (&local_error);
|
||||||
|
Loading…
Reference in New Issue
Block a user