Bug fix of sending wrong message 76/245376/2
authorhj kim <backto.kim@samsung.com>
Tue, 6 Oct 2020 08:14:57 +0000 (17:14 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 8 Oct 2020 03:06:49 +0000 (03:06 +0000)
and change variable from int to unsigned int.
because g_queue_get_length() returns unsigned int.

Change-Id: Iecf364312b725e89ab405ca7e0ad504f09dafab4

svc/media_controller_svc.c

index 5985c5c394219dad6fa106e09074e6a156fc9e16..d4bce527fdaae67d55b43cf9343d8970326c57c0 100644 (file)
@@ -547,7 +547,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;
 
@@ -557,9 +557,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;
@@ -576,6 +576,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;
        }