diff options
author | Havoc Pennington <hp@redhat.com> | 2003-03-31 20:56:29 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-03-31 20:56:29 +0000 |
commit | fa05de9230d62e7c427b5313796fc6ccd4d0ff60 (patch) | |
tree | 206890e8df6a575c150b901bf108b1c0a1e98824 /bus/activation.c | |
parent | 7af59334331fbd097a24c4942c75181882b96747 (diff) | |
download | dbus-fa05de9230d62e7c427b5313796fc6ccd4d0ff60.tar.gz |
2003-03-31 Havoc Pennington <hp@redhat.com>
Fix some annoying DBusString API and fix all affected code.
* dbus/dbus-string.c (_dbus_string_init): get rid of annoying
max_length argument
(_dbus_string_get_data): change to return string instead of using
an out param
(_dbus_string_get_const_data): ditto
(_dbus_string_get_data_len): ditto
(_dbus_string_get_const_data_len): ditto
Diffstat (limited to 'bus/activation.c')
-rw-r--r-- | bus/activation.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/bus/activation.c b/bus/activation.c index 8def99b9..fe069c79 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -204,13 +204,13 @@ load_directory (BusActivation *activation, iter = NULL; desktop_file = NULL; - if (!_dbus_string_init (&filename, _DBUS_INT_MAX)) + if (!_dbus_string_init (&filename)) { BUS_SET_OOM (error); return FALSE; } - if (!_dbus_string_init (&full_path, _DBUS_INT_MAX)) + if (!_dbus_string_init (&full_path)) { BUS_SET_OOM (error); _dbus_string_free (&filename); @@ -244,10 +244,8 @@ load_directory (BusActivation *activation, if (!_dbus_string_ends_with_c_str (&filename, ".service")) { - const char *filename_c; - _dbus_string_get_const_data (&filename, &filename_c); _dbus_verbose ("Skipping non-.service file %s\n", - filename_c); + _dbus_string_get_const_data (&filename)); continue; } @@ -255,11 +253,8 @@ load_directory (BusActivation *activation, if (desktop_file == NULL) { - const char *full_path_c; - - _dbus_string_get_const_data (&full_path, &full_path_c); - - _dbus_verbose ("Could not load %s: %s\n", full_path_c, + _dbus_verbose ("Could not load %s: %s\n", + _dbus_string_get_const_data (&full_path), tmp_error.message); if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY)) @@ -274,15 +269,11 @@ load_directory (BusActivation *activation, if (!add_desktop_file_entry (activation, desktop_file, &tmp_error)) { - const char *full_path_c; - bus_desktop_file_free (desktop_file); desktop_file = NULL; - - _dbus_string_get_const_data (&full_path, &full_path_c); _dbus_verbose ("Could not add %s to activation entry list: %s\n", - full_path_c, tmp_error.message); + _dbus_string_get_const_data (&full_path), tmp_error.message); if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY)) { |