[FIX] failed start_profiling leaves us inst run
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Tue, 22 Oct 2013 09:53:45 +0000 (13:53 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 22 Oct 2013 10:22:23 +0000 (10:22 +0000)
if US profiling have been started in kernel but we have some problems in
da_manager with start profiling we must stop profiling to avail accept
and proceed next start message

Change-Id: I2b542b98451498f8845d1243909529b9db6030ea
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/da_protocol.c

index 5b621c7..66e7d96 100644 (file)
@@ -968,6 +968,10 @@ static int process_msg_start(struct msg_buf_t *msg_control)
 
        if (start_profiling() < 0) {
                LOGE("cannot start profiling\n");
+               if (stop_all() != ERR_NO) {
+                       LOGE("Stop failed\n");
+                       write_msg_error("Stop failed");
+               }
                goto send_ack;
        }
 
@@ -1004,8 +1008,10 @@ int host_message_handler(struct msg_t *msg)
                return process_msg_start(&msg_control);
        case NMSG_STOP:
                sendACKToHost(msg->id, ERR_NO, 0, 0);
-               if (stop_all() != ERR_NO)
+               if (stop_all() != ERR_NO) {
+                       LOGE("Stop failed\n");
                        write_msg_error("Stop failed");
+               }
                break;
        case NMSG_CONFIG:
                error_code = ERR_NO;