cpc->type, delta, pos, cpc->threshold);
}
+static bool __is_file_ready(candidate_process_context_t *context)
+{
+ const char *path;
+ GList *iter;
+
+ iter = context->condition_path_exists;
+ while (iter != NULL) {
+ path = iter->data;
+ iter = g_list_next(iter);
+ if (access(path, F_OK) != 0) {
+ _D("%s does not exist", path);
+ return false;
+ }
+
+ context->condition_path_exists = g_list_remove(
+ context->condition_path_exists, path);
+ }
+
+ return true;
+}
+
static gboolean __handle_idle_checker(gpointer data)
{
unsigned long long total = 0;
return G_SOURCE_REMOVE;
}
+ if (!__is_file_ready(cpc)) {
+ _W("file is not ready");
+ __sequencer.idle_checker = 0;
+ __sequencer.running_cpc = NULL;
+ return G_SOURCE_REMOVE;
+ }
+
if (cpc->state != CANDIDATE_PROCESS_STATE_RUNNING) {
_W("Slot state is not running. loader(%s:%d)",
cpc->loader_name, cpc->type);
static gboolean __on_boot_timeout_cb(gpointer user_data)
{
candidate_process_context_t *context = user_data;
- const char *path;
- GList *iter;
_W("type(%d), loader_name(%s)", context->type, context->loader_name);
context->on_boot_timer = 0;
context->type, context->loader_name,
context->pid);
} else {
- iter = context->condition_path_exists;
- while (iter != NULL) {
- path = (char *)iter->data;
- iter = g_list_next(iter);
- if (access(path, F_OK) != 0) {
- _D("%s does not exist", path);
+ if (!__is_file_ready(context)) {
context->on_boot_timer = g_timeout_add(100,
__on_boot_timeout_cb, context);
return G_SOURCE_REMOVE;
- }
-
- context->condition_path_exists = g_list_remove(
- context->condition_path_exists, path);
}
__prepare_candidate_process(context->type, context->loader_id);