From: Ralf Habacker Date: Wed, 29 Dec 2010 11:31:42 +0000 (+0100) Subject: Use absolute session service dir path in bus-test on windows. X-Git-Tag: dbus-1.4.4~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02d973686a7dff06bb5868906a392c4c55e5ac84;p=thirdparty%2Fdbus.git Use absolute session service dir path in bus-test on windows. --- diff --git a/bus/config-parser.c b/bus/config-parser.c index 2d19f2b98..f128b91d1 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -30,6 +30,7 @@ #include "selinux.h" #include #include +#include #include 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)) diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index c1b8aebf5..295e02842 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -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 diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 024a8338a..b70ac6ae9 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -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 diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h index a8ff94333..74624b75a 100644 --- a/dbus/dbus-sysdeps-win.h +++ b/dbus/dbus-sysdeps-win.h @@ -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 */ diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index eb9195761..3955d8291 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.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 */