mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-04-06 08:20:42 +02:00
sysdeps-win: Add support to give auto launched dbus daemon custom parameter
For that purpose the function _dbus_test_win_set_autolaunch_command_line_parameter() has been added. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
This commit is contained in:
parent
08144b6ed8
commit
f20a05f60f
1 changed files with 22 additions and 1 deletions
|
|
@ -2895,6 +2895,26 @@ static const char *cDBusDaemonMutex = "DBusDaemonMutex";
|
|||
// named shm for dbus adress info (per user)
|
||||
static const char *cDBusDaemonAddressInfo = "DBusDaemonAddressInfo";
|
||||
|
||||
/* custom command line parameter for autolaunching daemon */
|
||||
static const char *autolaunch_custom_command_line_parameter = "";
|
||||
|
||||
/**
|
||||
* Set command line parameters for the dbus daemon to start
|
||||
* for an autolaunch session.
|
||||
*
|
||||
* The specified instance must be valid until the dbus-daemon
|
||||
* is started.
|
||||
*
|
||||
* This function is not thread-safe, and can only be called from a
|
||||
* single-threaded unit test.
|
||||
*
|
||||
* @param path string to use as command line parameter
|
||||
*/
|
||||
void _dbus_test_win_autolaunch_set_command_line_parameter (const char *path)
|
||||
{
|
||||
autolaunch_custom_command_line_parameter = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the hash of the installation root directory, which can be
|
||||
* used to construct a per-installation-root scope for autolaunching
|
||||
|
|
@ -3420,7 +3440,8 @@ _dbus_get_autolaunch_address (const char *scope,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (!_dbus_string_append_printf (&dbus_args, "\"%s\" --session", dbus_exe_path))
|
||||
if (!_dbus_string_append_printf (&dbus_args, "\"%s\" %s", dbus_exe_path,
|
||||
autolaunch_custom_command_line_parameter ? autolaunch_custom_command_line_parameter : "--session"))
|
||||
{
|
||||
dbus_set_error_const (error, DBUS_ERROR_NO_MEMORY, "Failed to append string to argument buffer");
|
||||
retval = FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue