Use absolute session service dir path in bus-test on windows.
authorRalf Habacker <ralf.habacker@freenet.de>
Wed, 29 Dec 2010 11:31:42 +0000 (12:31 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 29 Dec 2010 13:43:24 +0000 (14:43 +0100)
bus/config-parser.c
cmake/config.h.cmake
dbus/dbus-sysdeps-win.c
dbus/dbus-sysdeps-win.h
dbus/dbus-sysdeps.h

index 2d19f2b..f128b91 100644 (file)
@@ -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))
index c1b8aeb..295e028 100644 (file)
 #define _dbus_verbose_C_S _dbus_verbose
 #endif 
 
+#ifdef _MSC_VER
+/* avoid defines of ELEMENT_TYPE */
+#define _WINIOCTL_
+#endif
+
 #endif  // _DBUS_CONFIG_H
index 024a833..b70ac6a 100644 (file)
@@ -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
index a8ff943..74624b7 100644 (file)
@@ -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 */
index eb91957..3955d82 100644 (file)
@@ -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 */