Commit 02d97368 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Use absolute session service dir path in bus-test on windows.

parent 79026cee
......@@ -30,6 +30,7 @@
#include "selinux.h"
#include <dbus/dbus-list.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-sysdeps.h>
#include <string.h>
typedef enum
......@@ -3243,13 +3244,13 @@ static const char *test_session_service_dir_matches[] =
#ifdef DBUS_UNIX
"/testusr/testlocal/testshare/dbus-1/services",
"/testusr/testshare/dbus-1/services",
#endif
DBUS_DATADIR"/dbus-1/services",
#ifdef DBUS_UNIX
"/testhome/foo/.testlocal/testshare/dbus-1/services",
#endif
/* will be filled in test_default_session_servicedirs() */
#ifdef DBUS_WIN
NULL,
NULL,
#endif
NULL
};
......@@ -3263,6 +3264,16 @@ test_default_session_servicedirs (void)
const char *common_progs;
int i;
#ifdef DBUS_WIN
char buffer[1024];
if (_dbus_get_install_root(buffer, sizeof(buffer)))
{
strcat(buffer,DBUS_DATADIR);
strcat(buffer,"/dbus-1/services");
test_session_service_dir_matches[0] = buffer;
}
#endif
/* On Unix we don't actually use this variable, but it's easier to handle the
* deallocation if we always allocate it, whether needed or not */
if (!_dbus_string_init (&progs))
......
......@@ -247,4 +247,9 @@
#define _dbus_verbose_C_S _dbus_verbose
#endif
#ifdef _MSC_VER
/* avoid defines of ELEMENT_TYPE */
#define _WINIOCTL_
#endif
#endif // _DBUS_CONFIG_H
......@@ -2054,10 +2054,6 @@ _dbus_delete_file (const DBusString *filename,
return TRUE;
}
/* Forward declaration of prototype used in next function */
static dbus_bool_t
_dbus_get_install_root(char *prefix, int len);
/*
* replaces the term DBUS_PREFIX in configure_time_path by the
* current dbus installation directory. On unix this function is a noop
......@@ -2542,9 +2538,6 @@ static const char *cDBusDaemonMutex = "DBusDaemonMutex";
// named shm for dbus adress info (per user)
static const char *cDBusDaemonAddressInfo = "DBusDaemonAddressInfo";
dbus_bool_t
_dbus_get_install_root(char *prefix, int len);
static dbus_bool_t
_dbus_get_install_root_as_hash(DBusString *out)
{
......@@ -3103,7 +3096,7 @@ _dbus_get_is_errno_eagain_or_ewouldblock (void)
* @param len length of buffer
* @returns #FALSE on failure
*/
static dbus_bool_t
dbus_bool_t
_dbus_get_install_root(char *prefix, int len)
{
//To find the prefix, we cut the filename and also \bin\ if present
......
......@@ -83,6 +83,8 @@ dbus_bool_t _dbus_file_exists (const char *filename);
dbus_bool_t _dbus_get_config_file_name(DBusString *config_file,
char *s);
dbus_bool_t _dbus_get_install_root(char *prefix, int len);
#endif
/** @} end of sysdeps-win.h */
......@@ -531,4 +531,9 @@ _dbus_replace_install_prefix (const char *configure_time_path);
DBUS_END_DECLS
#ifdef DBUS_WIN
#include "dbus-sysdeps-win.h"
#endif
#endif /* DBUS_SYSDEPS_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment