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 <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-04-01 23:00:28 +04:00 committed by Simon McVittie
parent ed838d4169
commit d3dd8c5724
3 changed files with 22 additions and 1 deletions

View file

@ -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;

View file

@ -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 */

View file

@ -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 }