Remove duplicated functions and remove unnecessary code for stopping cmd
authorBoyeon <boyeon.son@samsung.com>
Mon, 13 May 2019 06:57:42 +0000 (15:57 +0900)
committer손보연/Tizen Platform Lab(SR)/Engineer/삼성전자 <boyeon.son@samsung.com>
Thu, 16 May 2019 06:23:11 +0000 (15:23 +0900)
src/devicemanagerservice.c

index 7ebab13..16e649e 100644 (file)
@@ -138,74 +138,15 @@ static void __get_log_archive(const char *log_path_arr[], const char *archive_fi
 
        if (ret != 0) {
                _E("failed to idm_command_set_info_cmd");
-               idm_command_stop(ad->command);
                idm_command_free(command);
                ad->command = NULL;
                return;
        }
 
        ret = idm_command_run(command, result_cb_func, ad);
-       if (ret != 0) {
-               _E("failed to idm_command_run");
-               idm_command_stop(ad->command);
-               idm_command_free(command);
-               ad->command = NULL;
-               return;
-       }
-}
-
-static void __get_log_archive_result_cb(idm_command_h command, idm_result_e result, idm_reason_e reason, const char *detail, void *data)
-{
-       unsigned long id;
-       idm_command_get_id(command, &id);
-
-       _D("[%d] result : %d, reason : %d, detail : %s", id, result, reason, detail ? detail : "None");
-
-       if (result != IDM_RESULT_RUNNING) {
-               app_data *ad = data;
-               idm_command_free(command);
-               ad->command = NULL;
-       }
-}
-
-static void __get_log_archive(const char *log_path_arr[], const char *archive_file, unsigned long id, idm_result_cb result_cb_func, void *data)
-{
-       app_data *ad = data;
-       idm_command_h command = NULL;
-       char *request = NULL;
-       int ret = -1;
 
-       idm_command_new(&command);
-       ret_if(!command);
-
-       idm_command_set_id(command, id);
-       ad->command = command;
-
-       request = __make_log_archive_request(log_path_arr, archive_file);
-       if (!request) {
-               _E("failed to make request");
-               idm_command_free(command);
-               ad->command = NULL;
-               return;
-       }
-
-       ret = idm_command_set_diagnosis_cmd(command, IDM_CMD_DIAGNOSIS_GET_LOG, request);
-
-       g_free(request);
-       request = NULL;
-
-       if (ret != 0) {
-               _E("failed to idm_command_set_info_cmd");
-               idm_command_stop(ad->command);
-               idm_command_free(command);
-               ad->command = NULL;
-               return;
-       }
-
-       ret = idm_command_run(command, result_cb_func, ad);
        if (ret != 0) {
                _E("failed to idm_command_run");
-               idm_command_stop(ad->command);
                idm_command_free(command);
                ad->command = NULL;
                return;