]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Rename getters for session, system config files
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 18 Sep 2015 16:52:07 +0000 (17:52 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 30 Sep 2015 14:49:29 +0000 (15:49 +0100)
It turns out to be easier to implement the Windows version
of these in a relocatable way if it can assume that the
argument starts empty, which is in fact true in practice.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
bus/main.c
dbus/dbus-sysdeps-util-unix.c
dbus/dbus-sysdeps-util-win.c
dbus/dbus-sysdeps.h

index ee5e1ebff7fc7c72fe3b0c0d78baef419f3524c9..612b4a6c96f0b6ca5fe0cb726db7ac58e6811b0f 100644 (file)
@@ -440,14 +440,14 @@ main (int argc, char **argv)
         {
           check_two_config_files (&config_file, "system");
 
-          if (!_dbus_append_system_config_file (&config_file))
+          if (!_dbus_get_system_config_file (&config_file))
             exit (1);
         }
       else if (strcmp (arg, "--session") == 0)
         {
           check_two_config_files (&config_file, "session");
 
-          if (!_dbus_append_session_config_file (&config_file))
+          if (!_dbus_get_session_config_file (&config_file))
             exit (1);
         }
       else if (strstr (arg, "--config-file=") == arg)
index 9b724cc92c264147313de122340c68d0cb1a373b..06a790a8b54dbc6952b4ed8eb5a7fa4186a5f555 100644 (file)
@@ -1424,27 +1424,31 @@ _dbus_get_standard_system_servicedirs (DBusList **dirs)
 }
 
 /**
- * Append the absolute path of the system.conf file
+ * Get the absolute path of the system.conf file
  * (there is no system bus on Windows so this can just
  * return FALSE and print a warning or something)
  *
- * @param str the string to append to
+ * @param str the string to append to, which must be empty on entry
  * @returns #FALSE if no memory
  */
 dbus_bool_t
-_dbus_append_system_config_file (DBusString *str)
+_dbus_get_system_config_file (DBusString *str)
 {
+  _dbus_assert (_dbus_string_get_length (str) == 0);
+
   return _dbus_string_append (str, DBUS_SYSTEM_CONFIG_FILE);
 }
 
 /**
- * Append the absolute path of the session.conf file.
+ * Get the absolute path of the session.conf file.
  *
- * @param str the string to append to
+ * @param str the string to append to, which must be empty on entry
  * @returns #FALSE if no memory
  */
 dbus_bool_t
-_dbus_append_session_config_file (DBusString *str)
+_dbus_get_session_config_file (DBusString *str)
 {
+  _dbus_assert (_dbus_string_get_length (str) == 0);
+
   return _dbus_string_append (str, DBUS_SESSION_CONFIG_FILE);
 }
index 096ffee3b09dd79af9721c24fedbd29d51706737..96100d49605e353989afbdcb26fdc2c9961faa62 100644 (file)
@@ -1677,27 +1677,31 @@ _dbus_get_config_file_name (DBusString *str,
 }
 
 /**
- * Append the absolute path of the system.conf file
+ * Get the absolute path of the system.conf file
  * (there is no system bus on Windows so this can just
  * return FALSE and print a warning or something)
  *
- * @param str the string to append to
+ * @param str the string to append to, which must be empty on entry
  * @returns #FALSE if no memory
  */
 dbus_bool_t
-_dbus_append_system_config_file (DBusString *str)
+_dbus_get_system_config_file (DBusString *str)
 {
+  _dbus_assert (_dbus_string_get_length (str) == 0);
+
   return _dbus_get_config_file_name(str, "system.conf");
 }
 
 /**
- * Append the absolute path of the session.conf file.
+ * Get the absolute path of the session.conf file.
  *
- * @param str the string to append to
+ * @param str the string to append to, which must be empty on entry
  * @returns #FALSE if no memory
  */
 dbus_bool_t
-_dbus_append_session_config_file (DBusString *str)
+_dbus_get_session_config_file (DBusString *str)
 {
+  _dbus_assert (_dbus_string_get_length (str) == 0);
+
   return _dbus_get_config_file_name(str, "session.conf");
 }
index 79a6cc7c9cb9e7be782b5944c0d0f83c9d18a6cf..fb338df9d3b4087f6109a89b2f8fa553eb748965 100644 (file)
@@ -432,8 +432,8 @@ dbus_bool_t _dbus_path_is_absolute    (const DBusString *filename);
 dbus_bool_t _dbus_get_standard_session_servicedirs (DBusList **dirs);
 dbus_bool_t _dbus_get_standard_system_servicedirs (DBusList **dirs);
 
-dbus_bool_t _dbus_append_system_config_file  (DBusString *str);
-dbus_bool_t _dbus_append_session_config_file (DBusString *str);
+dbus_bool_t _dbus_get_system_config_file  (DBusString *str);
+dbus_bool_t _dbus_get_session_config_file (DBusString *str);
 
 /** Opaque type for reading a directory listing */
 typedef struct DBusDirIter DBusDirIter;