diff options
Diffstat (limited to 'src/sm-helper.c')
-rw-r--r-- | src/sm-helper.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sm-helper.c b/src/sm-helper.c index 3794c30..f9e7ec3 100644 --- a/src/sm-helper.c +++ b/src/sm-helper.c @@ -229,3 +229,22 @@ GVariant* create_domain_data(struct domain_data* data) AFB_DEBUG("created domainData %d", __LINE__); return g_variant_builder_end (&builder); } + +bool send_result(const GError* result_of_send, struct afb_req req, const char* function){ + /* GError = NULL means success in case of gdbus request */ + if(result_of_send != NULL) + { + AFB_ERROR("Unable to call %s", function); + afb_req_fail_f(req, "failed", "Unable to call %s", function); + return false; + } + return true; +} + +bool send_result_no_resp(const GError* result_of_send, const char* function){ + if(result_of_send != NULL){ + AFB_ERROR("Unable to call %s", function); + return false; + } + return true; +}
\ No newline at end of file |