diff options
author | Maciej Slodczyk <m.slodczyk2@partner.samsung.com> | 2019-05-27 09:13:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2019-05-27 09:13:18 +0000 |
commit | d8a35df8fff2f1321c0ceaffb3fd8e0f903d5997 (patch) | |
tree | c8a9791c23b6e191575aa0a230b3fec8736a9ae4 /src/action/unit_start.c | |
parent | 407909b6e6527ea22d6483568316240f8c0c5c3c (diff) | |
parent | fb141c206318cc9c100c1f6ff563e7e3d176fb39 (diff) | |
download | activationd-d8a35df8fff2f1321c0ceaffb3fd8e0f903d5997.tar.gz activationd-d8a35df8fff2f1321c0ceaffb3fd8e0f903d5997.tar.bz2 activationd-d8a35df8fff2f1321c0ceaffb3fd8e0f903d5997.zip |
Merge "unit_start: Make unit actions asynchronous" into tizen
Diffstat (limited to 'src/action/unit_start.c')
-rw-r--r-- | src/action/unit_start.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/action/unit_start.c b/src/action/unit_start.c index 837b70b..b06ac4d 100644 --- a/src/action/unit_start.c +++ b/src/action/unit_start.c @@ -23,6 +23,21 @@ #include "systemd_dbus.h" #include "common.h" +static int unit_action_handler(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) +{ + struct action_executed_event *exe_info = userdata; + int ret; + + if (!exe_info) + return -EINVAL; + + exe_info->result = 0; + ret = event_processor_report_event(&exe_info->event); + epc_event_unref(&exe_info->event); + + return ret; +} + static int start_unit(struct epc_action *action, struct action_executed_event *exe_info) { @@ -66,9 +81,11 @@ static int start_unit(struct epc_action *action, return 0; } - ret = epc_dbus_call_systemd_simple(SYSTEMD_OBJ, + ret = epc_dbus_call_systemd_simple_async(SYSTEMD_OBJ, SYSTEMD_MANAGER_INTERFACE, unit_action, + unit_action_handler, + exe_info, "ss", unit_name, "replace"); @@ -78,7 +95,8 @@ static int start_unit(struct epc_action *action, else log_kmsg("Starting unit: %s", unit_name); - exe_info->result = ret; + exe_info->result = -EPROBE_DEFER; + epc_event_ref(&exe_info->event); return 0; } |