summaryrefslogtreecommitdiffstats
path: root/bus/dispatch.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2007-07-24 22:11:00 +0000
committerHavoc Pennington <hp@redhat.com>2007-07-24 22:11:00 +0000
commit79d3004e26f490ef37ae0298495ea66f322ce374 (patch)
treee42cc442c8e24330a1b1cc5446338befde93e3a6 /bus/dispatch.c
parent0b5478e49e250a85102ee0bf711609466a9437eb (diff)
2007-07-24 Havoc Pennington <hp@redhat.com>
* configure.in: add AM_PROG_CC_C_O to allow per-target CPPFLAGS * bus/dispatch.c (bus_dispatch_test_conf): Fix up setting TEST_LAUNCH_HELPER_CONFIG to include the full path, and enable test shell_fail_service_auto_start when use_launcher==TRUE * bus/activation-helper-bin.c (convert_error_to_exit_code): pass through the INVALID_ARGS error so the test suite works * bus/activation.c (handle_activation_exit_error): return DBUS_ERROR_NO_MEMORY if we get BUS_SPAWN_EXIT_CODE_NO_MEMORY * dbus/dbus-spawn.c (_dbus_babysitter_get_child_exit_status): return only the exit code of the child, not the entire thingy from waitpid(), and make the return value indicate whether the child exited normally (with a status code) * bus/bus.c (process_config_first_time_only): _dbus_strdup works on NULL so no need to check (process_config_every_time): move servicehelper init here, so we reload it on HUP or config file change * bus/Makefile.am (install-data-hook): remove comment because Emacs make mode seems to be grumpy about it
Diffstat (limited to 'bus/dispatch.c')
-rw-r--r--bus/dispatch.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index b020bb0b..d434e808 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -4408,6 +4408,40 @@ check2_try_iterations (BusContext *context,
}
static dbus_bool_t
+setenv_TEST_LAUNCH_HELPER_CONFIG(const DBusString *test_data_dir,
+ const char *filename)
+{
+ DBusString full;
+ DBusString file;
+
+ if (!_dbus_string_init (&full))
+ return FALSE;
+
+ if (!_dbus_string_copy (test_data_dir, 0, &full, 0))
+ {
+ _dbus_string_free (&full);
+ return FALSE;
+ }
+
+ _dbus_string_init_const (&file, filename);
+
+ if (!_dbus_concat_dir_and_file (&full, &file))
+ {
+ _dbus_string_free (&full);
+ return FALSE;
+ }
+
+ _dbus_verbose ("Setting TEST_LAUNCH_HELPER_CONFIG to '%s'\n",
+ _dbus_string_get_const_data (&full));
+
+ _dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG", _dbus_string_get_const_data (&full));
+
+ _dbus_string_free (&full);
+
+ return TRUE;
+}
+
+static dbus_bool_t
bus_dispatch_test_conf (const DBusString *test_data_dir,
const char *filename,
dbus_bool_t use_launcher)
@@ -4419,7 +4453,8 @@ bus_dispatch_test_conf (const DBusString *test_data_dir,
DBusError error;
/* save the config name for the activation helper */
- _dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG", filename);
+ if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename))
+ _dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG");
dbus_error_init (&error);
@@ -4524,9 +4559,8 @@ bus_dispatch_test_conf (const DBusString *test_data_dir,
#endif
/* only do the shell fail test if we are not using the launcher */
- if (!use_launcher)
- check2_try_iterations (context, foo, "shell_fail_service_auto_start",
- check_shell_fail_service_auto_start);
+ check2_try_iterations (context, foo, "shell_fail_service_auto_start",
+ check_shell_fail_service_auto_start);
/* specific to launcher */
if (use_launcher)
@@ -4572,8 +4606,9 @@ bus_dispatch_test_conf_fail (const DBusString *test_data_dir,
DBusError error;
/* save the config name for the activation helper */
- _dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG", filename);
-
+ if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename))
+ _dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG");
+
dbus_error_init (&error);
context = bus_context_new_test (test_data_dir, filename);