diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-03-08 12:08:11 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-03-08 08:29:35 +0000 |
commit | 08a28337118f5474b6ce73d3024dbd88d994cb93 (patch) | |
tree | a174adc62b97c86bb8a76c293a621c5edcbdb5c7 /src/sm-helper.c | |
parent | d17141136e7b75c174babce5b15e56fde6de063b (diff) |
Clean: clean up duplicate code
Change-Id: I99fdddbefa5fbb36bd0185a7541c7ff4eb4c921f
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
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 |