From 9151fe94cb21ef78c00b0ce0b7dfebdbc423830c Mon Sep 17 00:00:00 2001 From: msizanoen1 Date: Fri, 21 Oct 2022 21:57:28 +0700 Subject: [PATCH] gio: remove pointless use of g_unix_socket_address_abstract_names_supported with unix:tmpdir= There's no point in checking for g_unix_socket_address_abstract_names_supported now that unix:tmpdir= always use non-abstract sockets. --- gio/gdbusdaemon.c | 9 ++------- gio/tests/gdbus-auth.c | 15 ++++----------- gio/tests/gdbus-overflow.c | 9 ++------- gio/tests/gmenumodel.c | 9 ++------- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/gio/gdbusdaemon.c b/gio/gdbusdaemon.c index 8837b4819..5a8e523f0 100644 --- a/gio/gdbusdaemon.c +++ b/gio/gdbusdaemon.c @@ -1618,13 +1618,8 @@ initable_init (GInitable *initable, if (daemon->address == NULL) { #ifdef G_OS_UNIX - if (g_unix_socket_address_abstract_names_supported ()) - daemon->address = g_strdup ("unix:tmpdir=/tmp/gdbus-daemon"); - else - { - daemon->tmpdir = g_dir_make_tmp ("gdbus-daemon-XXXXXX", NULL); - daemon->address = g_strdup_printf ("unix:tmpdir=%s", daemon->tmpdir); - } + daemon->tmpdir = g_dir_make_tmp ("gdbus-daemon-XXXXXX", NULL); + daemon->address = g_strdup_printf ("unix:tmpdir=%s", daemon->tmpdir); flags |= G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER; #else /* Don’t require authentication on Windows as that hasn’t been diff --git a/gio/tests/gdbus-auth.c b/gio/tests/gdbus-auth.c index b0d163d98..e62f53f87 100644 --- a/gio/tests/gdbus-auth.c +++ b/gio/tests/gdbus-auth.c @@ -63,17 +63,10 @@ server_new_for_mechanism (const gchar *allowed_mechanism) guid = g_dbus_generate_guid (); #ifdef G_OS_UNIX - if (g_unix_socket_address_abstract_names_supported ()) - { - addr = g_strdup ("unix:tmpdir=/tmp/gdbus-test-"); - } - else - { - gchar *tmpdir; - tmpdir = g_dir_make_tmp ("gdbus-test-XXXXXX", NULL); - addr = g_strdup_printf ("unix:tmpdir=%s", tmpdir); - g_free (tmpdir); - } + gchar *tmpdir; + tmpdir = g_dir_make_tmp ("gdbus-test-XXXXXX", NULL); + addr = g_strdup_printf ("unix:tmpdir=%s", tmpdir); + g_free (tmpdir); #else addr = g_strdup ("nonce-tcp:"); #endif diff --git a/gio/tests/gdbus-overflow.c b/gio/tests/gdbus-overflow.c index e3896e1b1..b0dc89f0f 100644 --- a/gio/tests/gdbus-overflow.c +++ b/gio/tests/gdbus-overflow.c @@ -219,13 +219,8 @@ main (int argc, if (is_unix) { - if (g_unix_socket_address_abstract_names_supported ()) - tmp_address = g_strdup ("unix:tmpdir=/tmp/gdbus-test-"); - else - { - tmpdir = g_dir_make_tmp ("gdbus-test-XXXXXX", NULL); - tmp_address = g_strdup_printf ("unix:tmpdir=%s", tmpdir); - } + tmpdir = g_dir_make_tmp ("gdbus-test-XXXXXX", NULL); + tmp_address = g_strdup_printf ("unix:tmpdir=%s", tmpdir); } else tmp_address = g_strdup ("nonce-tcp:"); diff --git a/gio/tests/gmenumodel.c b/gio/tests/gmenumodel.c index 618a29eae..04ae2840b 100644 --- a/gio/tests/gmenumodel.c +++ b/gio/tests/gmenumodel.c @@ -831,13 +831,8 @@ service_thread_func (gpointer user_data) flags = G_DBUS_SERVER_FLAGS_NONE; #ifdef G_OS_UNIX - if (g_unix_socket_address_abstract_names_supported ()) - address = g_strdup ("unix:tmpdir=/tmp/test-dbus-peer"); - else - { - tmpdir = g_dir_make_tmp ("test-dbus-peer-XXXXXX", NULL); - address = g_strdup_printf ("unix:tmpdir=%s", tmpdir); - } + tmpdir = g_dir_make_tmp ("test-dbus-peer-XXXXXX", NULL); + address = g_strdup_printf ("unix:tmpdir=%s", tmpdir); #else address = g_strdup ("nonce-tcp:"); flags |= G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;