diff options
author | 2018-03-29 18:41:25 +0900 | |
---|---|---|
committer | 2018-03-29 21:39:59 +0900 | |
commit | f12c118f08b77d3bcfd0330961d7b90d11d9dd1a (patch) | |
tree | 61c616d16386b1114b44b582833cb6bc6bcc4ceb /src/sm-helper.c | |
parent | dbaa852ae76e592c5ab60eca4967c9952e681ef6 (diff) |
Add Error check with ErrorCode instead of GError
Change-Id: I56d12f2a2d1787e09e149b4931a1305925c44412
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/sm-helper.c')
-rw-r--r-- | src/sm-helper.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/sm-helper.c b/src/sm-helper.c index 0ccd1c7..c55eefb 100644 --- a/src/sm-helper.c +++ b/src/sm-helper.c @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #include "sm-helper.h" -#include "sm-def.h" #include <stdlib.h> #include <string.h> #include <limits.h> @@ -187,20 +185,21 @@ int sm_search_routing_event_name_index(const char* value) return ret; } -bool send_result(const GError* result_of_send, struct afb_req req, const char* function){ +bool send_result(ErrorCode ec, struct afb_req req, const char* function){ /* GError = NULL means success in case of gdbus request */ - if(result_of_send != NULL) + if(ec == UNABLE_SEND) { - AFB_ERROR("Unable to call %s", function); - afb_req_fail_f(req, "failed", "Unable to call %s", function); + AFB_ERROR("Unable to call : %s", function); + afb_req_fail_f(req, "failed", "%s : %s", + get_response_audiomanager_massage_error(ec), 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); +bool send_result_no_resp(ErrorCode ec, const char* function){ + if(ec == UNABLE_SEND){ + AFB_ERROR("Unable to call : %s", function); return false; } return true; |