From: Marc-André Lureau Date: Fri, 1 Apr 2022 19:00:28 +0000 (+0400) Subject: dbus: add _dbus_transport_open_unixexec() X-Git-Tag: dbus-1.15.0~26^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3dd8c5724012bb80dc9fca86aaf2afe22efb5e1;p=thirdparty%2Fdbus.git dbus: add _dbus_transport_open_unixexec() Split _dbus_transport_open_unix_socket() to leave the "unixexec:" handling to the unix-specific unit. Signed-off-by: Marc-André Lureau --- diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c index 9931da514..3afcb9397 100644 --- a/dbus/dbus-transport-unix.c +++ b/dbus/dbus-transport-unix.c @@ -272,7 +272,24 @@ _dbus_transport_open_unix_socket (DBusAddressEntry *entry, return DBUS_TRANSPORT_OPEN_OK; } } - else if (strcmp (method, "unixexec") == 0) + else + { + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + return DBUS_TRANSPORT_OPEN_NOT_HANDLED; + } +} + +DBusTransportOpenResult +_dbus_transport_open_unixexec (DBusAddressEntry *entry, + DBusTransport **transport_p, + DBusError *error) +{ + const char *method; + + method = dbus_address_entry_get_method (entry); + _dbus_assert (method != NULL); + + if (strcmp (method, "unixexec") == 0) { const char *path; unsigned i; diff --git a/dbus/dbus-transport-unix.h b/dbus/dbus-transport-unix.h index 952fa0a45..137311d76 100644 --- a/dbus/dbus-transport-unix.h +++ b/dbus/dbus-transport-unix.h @@ -35,6 +35,9 @@ DBusTransportOpenResult _dbus_transport_open_unix_socket (DBusAddressEntry *ent DBusTransport **transport_p, DBusError *error); +DBusTransportOpenResult _dbus_transport_open_unixexec (DBusAddressEntry *entry, + DBusTransport **transport_p, + DBusError *error); DBUS_END_DECLS #endif /* DBUS_TRANSPORT_UNIX_H */ diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index 9e189f840..dcb744048 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -350,6 +350,7 @@ static const struct { { _dbus_transport_open_socket }, #ifndef _WIN32 /* FIXME: removed in next patch */ { _dbus_transport_open_unix_socket }, + { _dbus_transport_open_unixexec }, #endif { _dbus_transport_open_platform_specific }, { _dbus_transport_open_autolaunch }