From fa42db7a8616bb9316522f0d2c54f0b86b041e8f Mon Sep 17 00:00:00 2001 From: hj kim Date: Tue, 6 Oct 2020 17:14:57 +0900 Subject: [PATCH] Bug fix of sending wrong message and change variable from int to unsigned int. because g_queue_get_length() returns unsigned int. Change-Id: Iecf364312b725e89ab405ca7e0ad504f09dafab4 --- svc/media_controller_svc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/svc/media_controller_svc.c b/svc/media_controller_svc.c index 0d99981..5c7e60d 100644 --- a/svc/media_controller_svc.c +++ b/svc/media_controller_svc.c @@ -512,7 +512,7 @@ static int __mc_service_app_dead_handler(int pid, void *data) static gboolean __mc_service_process(gpointer data) { - int length_of_queue = 0; + unsigned int length_of_queue = 0; int msg = MEDIA_CONTROLLER_ERROR_NONE; mc_service_t *_service_data = (mc_service_t*)data; @@ -522,9 +522,9 @@ static gboolean __mc_service_process(gpointer data) GQueue *request_queue = _service_data->request->queue; length_of_queue = g_queue_get_length(request_queue); - mc_info("Queue Length : %d", length_of_queue); + mc_info("Queue Length : %u", length_of_queue); - if (length_of_queue <= 0) { + if (length_of_queue == 0) { mc_debug("There is no request job in the queue"); g_source_unref(_service_data->request->source); _service_data->request->source = NULL; @@ -541,6 +541,7 @@ static gboolean __mc_service_process(gpointer data) mc_comm_msg_s *request_msg = req->req_msg; if (request_msg == NULL) { mc_error("Failed to get a request message from req"); + msg = MEDIA_CONTROLLER_ERROR_INVALID_OPERATION; goto ERROR; } -- 2.7.4