Care the exceptional cases more.
Change-Id: I945fd74a6581b030f2046c4c401ff9bd334f45d2
{
char *_str;
- if (!str)
+ if (!str) {
str = &_str;
+ }
switch (shortcut_type) {
case LIVEBOX_TYPE_1x1:
char _group[16];
char *size_str;
- if (s_info.ttl_timer)
+ if (s_info.ttl_timer) {
ecore_timer_reset(s_info.ttl_timer);
+ }
ret = packet_get(packet, "sssis", &edje_path, &group, &desc_file, &size_type, &output);
if (ret != 5) {
evas_object_resize(edje, w, h);
evas_object_show(edje);
- if (script_handler_parse_desc(edje, desc_file) != LB_STATUS_SUCCESS)
+ if (script_handler_parse_desc(edje, desc_file) != LB_STATUS_SUCCESS) {
ErrPrint("Unable to parse the %s\n", desc_file);
+ }
flush_to_file(e, output, w, h);
evas_object_del(edje);
out:
if (ret < 0) {
/* Desc file should be deleted if it fails to create an icon image */
- if (unlink(desc_file) < 0)
+ if (unlink(desc_file) < 0) {
ErrPrint("unlink(%s): %s\n", desc_file, strerror(errno));
+ }
}
return packet_create_reply(packet, "i", ret);
* Send a request to reigister as a service.
*/
s_info.ttl_timer = ecore_timer_add(TTL, life_timer_cb, NULL);
- if (!s_info.ttl_timer)
+ if (!s_info.ttl_timer) {
ErrPrint("Unable to register a life timer\n");
+ }
ret = vconf_notify_key_changed("db/setting/accessibility/font_name", font_changed_cb, NULL);
DbgPrint("System font is changed: %d\n", ret);
info = malloc(sizeof(*info));
if (!info) {
ErrPrint("Heap: %s\n", strerror(errno));
- fclose(fp);
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
return LB_STATUS_ERROR_MEMORY;
}
info->id = NULL;
if (!isspace(ch) && ch != EOF) {
ErrPrint("%d: Syntax error: Desc is not started with '{' or space - (%c = 0x%x)\n", lineno, ch, ch);
- fclose(fp);
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
return LB_STATUS_ERROR_INVALID;
}
break;
block = calloc(1, sizeof(*block));
if (!block) {
ErrPrint("Heap: %s\n", strerror(errno));
- fclose(fp);
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
return LB_STATUS_ERROR_MEMORY;
}
goto errout;
}
- fclose(fp);
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
return LB_STATUS_SUCCESS;
errout:
ErrPrint("Parse error at %d file %s\n", lineno, util_basename(descfile));
- if (block)
+ if (block) {
delete_block(block);
- fclose(fp);
+ }
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
return LB_STATUS_ERROR_INVALID;
}
Name: org.tizen.data-provider-slave
Summary: Plugin type livebox service provider.
-Version: 0.12.7
+Version: 0.12.9
Release: 1
Group: HomeTF/Livebox
License: Flora License
static int method_pause(struct event_arg *arg, void *data)
{
lb_pause_all();
- if (s_info.ping_timer)
+ if (s_info.ping_timer) {
ecore_timer_freeze(s_info.ping_timer);
+ }
sqlite3_release_memory(SQLITE_FLUSH_MAX);
malloc_trim(0);
static int method_resume(struct event_arg *arg, void *data)
{
lb_resume_all();
- if (s_info.ping_timer)
+ if (s_info.ping_timer) {
ecore_timer_thaw(s_info.ping_timer);
+ }
return LB_STATUS_SUCCESS;
}
ret = provider_send_hello();
if (ret == 0) {
s_info.ping_timer = ecore_timer_add(DEFAULT_PING_TIME, send_ping_cb, NULL);
- if (!s_info.ping_timer)
+ if (!s_info.ping_timer) {
ErrPrint("Failed to add a ping timer\n");
+ }
}
return LB_STATUS_SUCCESS;
static void provider_method_handler(char *buffer)
{
g_conf.provider_method = strdup(buffer);
- if (!g_conf.provider_method)
+ if (!g_conf.provider_method) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void debug_mode_handler(char *buffer)
static void base_width_handler(char *buffer)
{
- if (sscanf(buffer, "%d", &g_conf.base_width) != 1)
+ if (sscanf(buffer, "%d", &g_conf.base_width) != 1) {
ErrPrint("Failed to parse the base_width\n");
+ }
}
static void base_height_handler(char *buffer)
{
- if (sscanf(buffer, "%d", &g_conf.base_height) != 1)
+ if (sscanf(buffer, "%d", &g_conf.base_height) != 1) {
ErrPrint("Failed to parse the base_height\n");
+ }
}
static void minimum_period_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.minimum_period) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.minimum_period) != 1) {
ErrPrint("Failed to parse the minimum_period\n");
+ }
DbgPrint("Minimum period: %lf\n", g_conf.minimum_period);
}
static void script_handler(char *buffer)
{
g_conf.default_conf.script = strdup(buffer);
- if (!g_conf.default_conf.script)
+ if (!g_conf.default_conf.script) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void default_abi_handler(char *buffer)
{
g_conf.default_conf.abi = strdup(buffer);
- if (!g_conf.default_conf.abi)
+ if (!g_conf.default_conf.abi) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void default_group_handler(char *buffer)
{
g_conf.default_conf.pd_group = strdup(buffer);
- if (!g_conf.default_conf.pd_group)
+ if (!g_conf.default_conf.pd_group) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void default_period_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.default_conf.period) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.default_conf.period) != 1) {
ErrPrint("Failed to parse the default_period\n");
+ }
DbgPrint("Default Period: %lf\n", g_conf.default_conf.period);
}
static void default_packet_time_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.default_packet_time) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.default_packet_time) != 1) {
ErrPrint("Failed to parse the default_packet_time\n");
+ }
DbgPrint("Default packet time: %lf\n", g_conf.default_packet_time);
}
static void default_content_handler(char *buffer)
{
g_conf.default_content = strdup(buffer);
- if (!g_conf.default_content)
+ if (!g_conf.default_content) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void default_title_handler(char *buffer)
{
g_conf.default_title = strdup(buffer);
- if (!g_conf.default_title)
+ if (!g_conf.default_title) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void minimum_space_handler(char *buffer)
{
- if (sscanf(buffer, "%lu", &g_conf.minimum_space) != 1)
+ if (sscanf(buffer, "%lu", &g_conf.minimum_space) != 1) {
ErrPrint("Failed to parse the minimum_space\n");
+ }
}
static void replace_tag_handler(char *buffer)
{
g_conf.replace_tag = strdup(buffer);
- if (!g_conf.replace_tag)
+ if (!g_conf.replace_tag) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void slave_ttl_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.slave_ttl) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.slave_ttl) != 1) {
ErrPrint("Failed to parse the slave_ttl\n");
+ }
DbgPrint("Slave TTL: %lf\n", g_conf.slave_ttl);
}
static void slave_activate_time_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.slave_activate_time) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.slave_activate_time) != 1) {
ErrPrint("Failed to parse the slave_activate_time\n");
+ }
DbgPrint("Slave activate time: %lf\n", g_conf.slave_activate_time);
}
static void slave_relaunch_time_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.slave_relaunch_time) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.slave_relaunch_time) != 1) {
ErrPrint("Failed to parse the slave_relaunch_time\n");
+ }
DbgPrint("Slave relaunch time: %lf\n", g_conf.slave_relaunch_time);
}
static void slave_relaunch_count_handler(char *buffer)
{
- if (sscanf(buffer, "%d", &g_conf.slave_relaunch_count) != 1)
+ if (sscanf(buffer, "%d", &g_conf.slave_relaunch_count) != 1) {
ErrPrint("Failed to parse the relaunch count\n");
+ }
}
static void max_log_line_handler(char *buffer)
{
- if (sscanf(buffer, "%d", &g_conf.max_log_line) != 1)
+ if (sscanf(buffer, "%d", &g_conf.max_log_line) != 1) {
ErrPrint("Failed to parse the max_log_line\n");
+ }
}
static void max_log_file_handler(char *buffer)
{
- if (sscanf(buffer, "%d", &g_conf.max_log_file) != 1)
+ if (sscanf(buffer, "%d", &g_conf.max_log_file) != 1) {
ErrPrint("Failed to parse the max_log_file\n");
+ }
}
static void sqlite_flush_max_handler(char *buffer)
{
- if (sscanf(buffer, "%lu", &g_conf.sqlite_flush_max) != 1)
+ if (sscanf(buffer, "%lu", &g_conf.sqlite_flush_max) != 1) {
ErrPrint("Failed to parse the sqlite_flush_max\n");
+ }
}
static void db_path_handler(char *buffer)
{
g_conf.path.db = strdup(buffer);
- if (!g_conf.path.db)
+ if (!g_conf.path.db) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void reader_path_handler(char *buffer)
{
g_conf.path.reader = strdup(buffer);
- if (!g_conf.path.reader)
+ if (!g_conf.path.reader) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void always_path_handler(char *buffer)
{
g_conf.path.always = strdup(buffer);
- if (!g_conf.path.always)
+ if (!g_conf.path.always) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void log_path_handler(char *buffer)
{
g_conf.path.slave_log = strdup(buffer);
- if (!g_conf.path.slave_log)
+ if (!g_conf.path.slave_log) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void script_port_path_handler(char *buffer)
{
g_conf.path.script_port = strdup(buffer);
- if (!g_conf.path.script_port)
+ if (!g_conf.path.script_port) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void share_path_handler(char *buffer)
{
g_conf.path.image = strdup(buffer);
- if (!g_conf.path.image)
+ if (!g_conf.path.image) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void input_path_handler(char *buffer)
{
g_conf.path.input = strdup(buffer);
- if (!g_conf.path.input)
+ if (!g_conf.path.input) {
ErrPrint("Heap: %s\n", strerror(errno));
+ }
}
static void ping_time_handler(char *buffer)
{
- if (sscanf(buffer, "%lf", &g_conf.ping_time) != 1)
+ if (sscanf(buffer, "%lf", &g_conf.ping_time) != 1) {
ErrPrint("Failed to parse the ping_time\n");
+ }
g_conf.ping_time /= 2.0f; /*!< Half */
DbgPrint("Default ping time: %lf\n", g_conf.ping_time);
}
static void slave_max_loader(char *buffer)
{
- if (sscanf(buffer, "%d", &g_conf.slave_max_load) != 1)
+ if (sscanf(buffer, "%d", &g_conf.slave_max_load) != 1) {
ErrPrint("Failed to parse the slave_max_load\n");
+ }
}
HAPI int conf_loader(void)
/* Ignore empty space */
} else {
state = TOKEN;
- ungetc(c, fp);
+ if (ungetc(c, fp) != c) {
+ ErrPrint("ungetc: %s\n", strerror(errno));
+ }
}
break;
case SPACE:
- if (c == '=')
+ if (c == '=') {
state = VALUE;
- else if (!isspace(c))
+ } else if (!isspace(c)) {
state = ERROR;
+ }
break;
case VALUE:
if (c == '"') {
state = END;
} else if (buffer_idx != 0) {
buffer[buffer_idx++] = c;
- if (buffer_idx >= sizeof(buffer))
+ if (buffer_idx >= sizeof(buffer)) {
state = ERROR;
+ }
} else {
quote = 1;
}
/* Ignore */
} else if (quote == 1) {
buffer[buffer_idx++] = c;
- if (buffer_idx >= sizeof(buffer))
+ if (buffer_idx >= sizeof(buffer)) {
state = ERROR;
+ }
} else {
buffer[buffer_idx] = '\0';
- ungetc(c, fp);
+ if (ungetc(c, fp) != c) {
+ ErrPrint("ungetc: %s\n", strerror(errno));
+ }
state = END;
}
} else {
buffer[buffer_idx++] = c;
- if (buffer_idx >= sizeof(buffer))
+ if (buffer_idx >= sizeof(buffer)) {
state = ERROR;
+ }
}
break;
case TOKEN:
if (c == '=') {
- if (token_idx < 0)
+ if (token_idx < 0) {
state = ERROR;
- else
+ } else {
state = VALUE;
+ }
} else if (isspace(c)) {
- if (token_idx < 0)
+ if (token_idx < 0) {
break;
+ }
- if (token_handler[token_idx].name[ch_idx] != '\0')
+ if (token_handler[token_idx].name[ch_idx] != '\0') {
state = ERROR;
- else
+ } else {
state = SPACE;
+ }
} else {
if (token_idx < 0) {
/* Now start to find a token! */
if (token_handler[token_idx].name[ch_idx] == c) {
ch_idx++;
} else {
- ungetc(c, fp);
- while (ch_idx-- > 0)
- ungetc(token_handler[token_idx].name[ch_idx], fp);
+ if (ungetc(c, fp) != c) {
+ ErrPrint("ungetc: %s\n", strerror(errno));
+ }
+ while (ch_idx-- > 0) {
+ if (ungetc(token_handler[token_idx].name[ch_idx], fp) != token_handler[token_idx].name[ch_idx]) {
+ ErrPrint("ungetc: %s\n", strerror(errno));
+ }
+ }
token_idx++;
- if (token_handler[token_idx].name == NULL)
+ if (token_handler[token_idx].name == NULL) {
state = ERROR;
- else
+ } else {
ch_idx = 0;
+ }
}
}
break;
linelen++;
} while (c != EOF);
- fclose(fp);
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
return LB_STATUS_SUCCESS;
}
char *filename;
int namelen;
- if (s_info.nr_of_lines < MAX_LOG_LINE)
+ if (s_info.nr_of_lines < MAX_LOG_LINE) {
return;
+ }
s_info.file_id = (s_info.file_id + 1) % MAX_LOG_FILE;
if (filename) {
snprintf(filename, namelen, "%s/%d_%s.%d", SLAVE_LOG_PATH, s_info.file_id, s_info.filename, getpid());
- if (s_info.fp)
- fclose(s_info.fp);
+ if (s_info.fp) {
+ if (fclose(s_info.fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
+ }
s_info.fp = fopen(filename, "w+");
- if (!s_info.fp)
+ if (!s_info.fp) {
ErrPrint("Failed to open a file: %s\n", filename);
+ }
DbgFree(filename);
}
va_list ap;
int ret;
- if (!s_info.fp)
+ if (!s_info.fp) {
return LB_STATUS_ERROR_IO;
+ }
fprintf(s_info.fp, "%lf [%s:%d] ", util_timestamp(), util_basename((char *)func), line);
ret = vfprintf(s_info.fp, fmt, ap);
va_end(ap);
- fflush(s_info.fp);
+ if (fflush(s_info.fp) != 0) {
+ ErrPrint("fflush: %s\n", strerror(errno));
+ }
s_info.nr_of_lines++;
rotate_log();
int namelen;
char *filename;
- if (s_info.fp)
+ if (s_info.fp) {
return LB_STATUS_SUCCESS;
+ }
s_info.filename = strdup(name);
if (!s_info.filename) {
}
if (s_info.fp) {
- fclose(s_info.fp);
+ if (fclose(s_info.fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
s_info.fp = NULL;
}
snprintf(log_fname, sizeof(log_fname), "%s/slave.%d", SLAVE_LOG_PATH, getpid());
fd = open(log_fname, O_WRONLY|O_CREAT|O_SYNC, 0644);
if (fd >= 0) {
- if (write(fd, so_fname, strlen(so_fname)) != strlen(so_fname))
+ if (write(fd, so_fname, strlen(so_fname)) != strlen(so_fname)) {
ErrPrint("Failed to recording the fault SO filename (%s)\n", so_fname);
- close(fd);
+ }
+ if (close(fd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
}
}
act.sa_sigaction = signal_handler;
act.sa_flags = SA_SIGINFO;
- if (sigemptyset(&act.sa_mask) != 0)
+ if (sigemptyset(&act.sa_mask) != 0) {
ErrPrint("Failed to init signal: %s\n", strerror(errno));
+ }
- if (sigaddset(&act.sa_mask, SIGUSR1) != 0)
+ if (sigaddset(&act.sa_mask, SIGUSR1) != 0) {
ErrPrint("Failed to add set: %s\n", strerror(errno));
- if (sigaddset(&act.sa_mask, SIGALRM) != 0)
+ }
+ if (sigaddset(&act.sa_mask, SIGALRM) != 0) {
ErrPrint("Failed to add set: %s\n", strerror(errno));
+ }
ecore_abort = getenv("ECORE_ERROR_ABORT");
if (!ecore_abort || ecore_abort[0] != '1') {
- if (sigaddset(&act.sa_mask, SIGSEGV) != 0)
+ if (sigaddset(&act.sa_mask, SIGSEGV) != 0) {
ErrPrint("Failed to add set: %s\n", strerror(errno));
- if (sigaddset(&act.sa_mask, SIGABRT) != 0)
+ }
+ if (sigaddset(&act.sa_mask, SIGABRT) != 0) {
ErrPrint("Failed to add set: %s\n", strerror(errno));
- if (sigaddset(&act.sa_mask, SIGILL) != 0)
+ }
+ if (sigaddset(&act.sa_mask, SIGILL) != 0) {
ErrPrint("Failed to add set: %s\n", strerror(errno));
+ }
- if (sigaction(SIGSEGV, &act, NULL) < 0)
+ if (sigaction(SIGSEGV, &act, NULL) < 0) {
ErrPrint("Failed to install the SEGV handler\n");
+ }
- if (sigaction(SIGABRT, &act, NULL) < 0)
+ if (sigaction(SIGABRT, &act, NULL) < 0) {
ErrPrint("Faield to install the ABRT handler\n");
+ }
- if (sigaction(SIGILL, &act, NULL) < 0)
+ if (sigaction(SIGILL, &act, NULL) < 0) {
ErrPrint("Faield to install the ILL handler\n");
+ }
}
- if (sigaction(SIGUSR1, &act, NULL) < 0)
+ if (sigaction(SIGUSR1, &act, NULL) < 0) {
ErrPrint("Failed to install the USR1 handler\n");
+ }
- if (sigaction(SIGALRM, &act, NULL) < 0)
+ if (sigaction(SIGALRM, &act, NULL) < 0) {
ErrPrint("Failed to install the ALRM handler\n");
+ }
return 0;
}
HAPI int fault_mark_call(const char *pkgname, const char *filename, const char *funcname, int noalarm, int life_time)
{
- if (!s_info.disable_checker)
+ if (!s_info.disable_checker) {
provider_send_call(pkgname, filename, funcname);
+ }
/*!
* \NOTE
* To use this "alarm", the livebox have to do not use the 'sleep' series functions.
s_info.marked = 0;
}
- if (!s_info.disable_checker)
+ if (!s_info.disable_checker) {
provider_send_ret(pkgname, filename, funcname);
+ }
return 0;
}
static void pending_timer_thaw(void)
{
DbgPrint("Freezed Count: %d\n", s_info.pending_timer_freezed);
- if (!s_info.pending_timer_freezed)
+ if (!s_info.pending_timer_freezed) {
return;
+ }
s_info.pending_timer_freezed--;
if (s_info.pending_timer && !s_info.pending_timer_freezed) {
i = 0;
EINA_LIST_FOREACH(s_info.pd_list, l, tmp) {
- if (pkgname && !strcmp(pkgname, tmp))
+ if (pkgname && !strcmp(pkgname, tmp)) {
return 1;
+ }
i++;
}
struct item *item;
item = eina_list_nth(s_info.pd_open_pending_list, 0);
- if (!item)
+ if (!item) {
goto cleanout;
+ }
- if (s_info.update)
+ if (s_info.update) {
return ECORE_CALLBACK_RENEW;
+ }
s_info.pd_open_pending_list = eina_list_remove(s_info.pd_open_pending_list, item);
/*!
/* Item is destroyed */
}
- if (s_info.pd_open_pending_list)
+ if (s_info.pd_open_pending_list) {
return ECORE_CALLBACK_RENEW;
+ }
cleanout:
s_info.pd_open_pending_timer = NULL;
struct item *item;
item = eina_list_nth(s_info.pending_list, 0);
- if (!item)
+ if (!item) {
goto cleanout;
+ }
- if (s_info.update || pd_is_opened(item->inst->item->pkgname) < 0)
+ if (s_info.update || pd_is_opened(item->inst->item->pkgname) < 0) {
return ECORE_CALLBACK_RENEW;
+ }
s_info.pending_list = eina_list_remove(s_info.pending_list, item);
/*!
/* item is destroyed */
}
- if (s_info.pending_list)
+ if (s_info.pending_list) {
return ECORE_CALLBACK_RENEW;
+ }
cleanout:
s_info.pending_timer = NULL;
static inline __attribute__((always_inline)) int activate_pending_consumer(void)
{
- if (s_info.pending_timer)
+ if (s_info.pending_timer) {
return 0;
+ }
s_info.pending_timer = ecore_timer_add(0.000001f, pended_cmd_consumer_cb, NULL);
if (!s_info.pending_timer) {
* Do not increase the freezed counter.
* Just freeze the timer.
*/
- if (s_info.pending_timer_freezed)
+ if (s_info.pending_timer_freezed) {
ecore_timer_freeze(s_info.pending_timer);
+ }
return 0;
}
static inline void deactivate_pending_consumer(void)
{
- if (!s_info.pending_timer)
+ if (!s_info.pending_timer) {
return;
+ }
ecore_timer_del(s_info.pending_timer);
s_info.pending_timer = NULL;
static inline void deactivate_pd_open_pending_consumer(void)
{
- if (!s_info.pd_open_pending_timer)
+ if (!s_info.pd_open_pending_timer) {
return;
+ }
ecore_timer_del(s_info.pd_open_pending_timer);
s_info.pd_open_pending_timer = NULL;
static inline int __attribute__((always_inline)) activate_pd_open_pending_consumer(void)
{
- if (s_info.pd_open_pending_timer)
+ if (s_info.pd_open_pending_timer) {
return 0;
+ }
s_info.pd_open_pending_timer = ecore_timer_add(0.000001f, pd_open_pended_cmd_consumer_cb, NULL);
if (!s_info.pd_open_pending_timer) {
int cnt = 0;
EINA_LIST_FOREACH_SAFE(s_info.pending_list, l, n, item) {
- if (strcmp(pkgname, item->inst->item->pkgname))
+ if (strcmp(pkgname, item->inst->item->pkgname)) {
continue;
+ }
s_info.pending_list = eina_list_remove(s_info.pending_list, item);
s_info.pd_open_pending_list = eina_list_append(s_info.pd_open_pending_list, item);
cnt++;
}
- if (s_info.pd_open_pending_list)
+ if (s_info.pd_open_pending_list) {
activate_pd_open_pending_consumer();
+ }
- if (!s_info.pending_list)
+ if (!s_info.pending_list) {
deactivate_pending_consumer();
+ }
}
static inline void migrate_to_pending_list(const char *pkgname)
int cnt = 0;
EINA_LIST_FOREACH_SAFE(s_info.pd_open_pending_list, l, n, item) {
- if (strcmp(pkgname, item->inst->item->pkgname))
+ if (strcmp(pkgname, item->inst->item->pkgname)) {
continue;
+ }
s_info.pd_open_pending_list = eina_list_remove(s_info.pd_open_pending_list, item);
s_info.pending_list = eina_list_append(s_info.pending_list, item);
cnt++;
}
- if (s_info.pending_list)
+ if (s_info.pending_list) {
activate_pending_consumer();
+ }
- if (!s_info.pd_open_pending_list)
+ if (!s_info.pd_open_pending_list) {
deactivate_pd_open_pending_consumer();
+ }
}
static inline int is_pended_item(struct item *item)
return LB_STATUS_ERROR_EXIST;
}
- if (activate_pending_consumer() < 0)
+ if (activate_pending_consumer() < 0) {
return LB_STATUS_ERROR_FAULT;
+ }
s_info.pending_list = eina_list_append(s_info.pending_list, item);
}
double delay;
double sleep_time;
- if (!item->timer)
+ if (!item->timer) {
return 0;
+ }
ecore_timer_thaw(item->timer);
period = ecore_timer_interval_get(item->timer);
delay = util_time_delay_for_compensation(period) - pending;
ecore_timer_delay(item->timer, delay);
- if (item->sleep_at == 0.0f)
+ if (item->sleep_at == 0.0f) {
return 0;
+ }
sleep_time = util_timestamp() - item->sleep_at;
item->sleep_at = 0.0f;
return UPDATE_NOT_INVOKED;
}
-static inline void timer_freeze(struct item *item)
+static void timer_freeze(struct item *item)
{
struct timeval tv;
- if (!item->timer)
+ if (!item->timer) {
return;
+ }
ecore_timer_freeze(item->timer);
- if (ecore_timer_interval_get(item->timer) <= 1.0f)
+ if (ecore_timer_interval_get(item->timer) <= 1.0f) {
return;
+ }
if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
struct item *item;
EINA_LIST_FOREACH(s_info.item_list, l, item) {
- if (item->inst == inst)
+ if (item->inst == inst) {
return l;
+ }
}
return NULL;
}
if (item->monitor_cnt == 0) {
- if (!invalid)
+ if (!invalid) {
fault_unmark_call(item->inst->item->pkgname, item->inst->id, "update,crashed", NO_ALARM);
+ }
if (item->monitor) {
ecore_timer_del(item->monitor);
item->monitor = NULL;
}
- if (s_info.update == item)
+ if (s_info.update == item) {
s_info.update = NULL;
+ }
if (item->deleteme) {
provider_send_deleted(item->inst->item->pkgname, item->inst->id);
{
struct item *item;
- if (over)
+ if (over) {
WarnPrint("Event Q overflow\n");
+ }
item = data;
char *title = NULL;
int ret;
- if (over)
+ if (over) {
WarnPrint("Event Q overflow\n");
+ }
item = data;
static void reset_lb_updated_flag(struct item *item)
{
- if (!item->is_lb_updated)
+ if (!item->is_lb_updated) {
return;
+ }
DbgPrint("[%s] Updated %d times, (content: %s), (title: %s)\n",
item->inst->id, item->is_lb_updated,
struct item *tmp;
EINA_LIST_FOREACH(s_info.pd_open_pending_list, l, tmp) {
- if (tmp != item)
+ if (tmp != item) {
continue;
+ }
s_info.pd_open_pending_list = eina_list_remove_list(s_info.pd_open_pending_list, l);
- if (!s_info.pd_open_pending_list)
+ if (!s_info.pd_open_pending_list) {
deactivate_pd_open_pending_consumer();
+ }
return LB_STATUS_SUCCESS;
}
struct item *tmp;
EINA_LIST_FOREACH(s_info.pending_list, l, tmp) {
- if (tmp != item)
+ if (tmp != item) {
continue;
+ }
s_info.pending_list = eina_list_remove_list(s_info.pending_list, l);
- if (!s_info.pending_list)
+ if (!s_info.pending_list) {
deactivate_pending_consumer();
+ }
return LB_STATUS_SUCCESS;
}
ErrPrint("UPDATE TIMEOUT ========> %s - %s\n", item->inst->item->pkgname, item->inst->id);
- if (s_info.update != item)
+ if (s_info.update != item) {
ErrPrint("Updating item is not matched\n");
+ }
fault_unmark_call(item->inst->item->pkgname, item->inst->id, "update,crashed", NO_ALARM);
fault_mark_call(item->inst->item->pkgname, item->inst->id, "update,timeout", NO_ALARM, DEFAULT_LIFE_TIMER);
item = data;
- if (item->monitor) {/*!< If this item is already in update process */
+ if (item->monitor) { /*!< If this item is already in update process */
return ECORE_CALLBACK_RENEW;
}
*/
fault_mark_call(item->inst->item->pkgname, item->inst->id, "update,crashed", NO_ALARM, DEFAULT_LIFE_TIMER);
- if (ret & NEED_TO_SCHEDULE)
+ if (ret & NEED_TO_SCHEDULE) {
(void)append_pending_list(item);
+ }
if (ret & OUTPUT_UPDATED) {
/*!
struct item *item;
EINA_LIST_FOREACH(s_info.item_list, l, item) {
- if (!strcmp(item->inst->id, filename))
+ if (!strcmp(item->inst->id, filename)) {
return item->inst->item->pkgname;
+ }
}
return NULL;
char *tmp;
EINA_LIST_FOREACH(s_info.pd_list, l, tmp) {
- if (!strcmp(pkgname, tmp))
+ if (!strcmp(pkgname, tmp)) {
return 0;
+ }
}
tmp = strdup(pkgname);
return LB_STATUS_ERROR_MEMORY;
}
- if (!s_info.pd_list)
+ if (!s_info.pd_list) {
pending_timer_freeze();
+ }
s_info.pd_list = eina_list_append(s_info.pd_list, tmp);
char *tmp;
EINA_LIST_FOREACH_SAFE(s_info.pd_list, l, n, tmp) {
- if (strcmp(tmp, pkgname))
+ if (strcmp(tmp, pkgname)) {
continue;
+ }
s_info.pd_list = eina_list_remove(s_info.pd_list, tmp);
free(tmp);
- if (!s_info.pd_list)
+ if (!s_info.pd_list) {
pending_timer_thaw();
+ }
/*!
* Move all items in pd_open_pending_list
if (!skip_need_to_create) {
ret = so_create_needed(pkgname, cluster, category, abi);
- if (ret != NEED_TO_CREATE)
+ if (ret != NEED_TO_CREATE) {
return LB_STATUS_ERROR_PERMISSION;
+ }
need_to_create = 1;
}
return LB_STATUS_ERROR_FAULT;
}
- if (s_info.paused)
+ if (s_info.paused) {
timer_freeze(item);
+ }
} else {
DbgPrint("Local update timer is disabled: %lf (%d)\n", period, s_info.secured);
item->timer = NULL;
char *tmp;
tmp = strdup(*out_content);
- if (!tmp)
+ if (!tmp) {
ErrPrint("Memory: %s\n", strerror(errno));
+ }
*out_content = tmp;
}
char *tmp;
tmp = strdup(*out_title);
- if (!tmp)
+ if (!tmp) {
ErrPrint("Memory: %s\n", strerror(errno));
+ }
*out_title = tmp;
}
item = eina_list_data_get(l);
s_info.item_list = eina_list_remove_list(s_info.item_list, l);
- if (s_info.update == item)
+ if (s_info.update == item) {
s_info.update = NULL;
+ }
if (item->timer) {
clear_from_pd_open_pending_list(item);
ecore_timer_del(item->timer);
item->timer = NULL;
- if (item->monitor)
+ if (item->monitor) {
item->deleteme = 1;
- else
+ } else {
update_monitor_del(id, item);
+ }
}
if (!item->monitor) {
item = eina_list_data_get(l);
ret = so_resize(inst, w, h);
- if (ret < 0)
+ if (ret < 0) {
return ret;
+ }
if (ret & NEED_TO_SCHEDULE) {
DbgPrint("%s Returns NEED_TO_SCHEDULE\n", pkgname);
(void)append_pending_list(item);
}
- if (ret & OUTPUT_UPDATED)
+ if (ret & OUTPUT_UPDATED) {
update_monitor_cnt(item);
+ }
return LB_STATUS_SUCCESS;
}
return LB_STATUS_ERROR_FAULT;
}
- if (s_info.paused)
+ if (s_info.paused) {
timer_freeze(item);
+ }
}
}
item = eina_list_data_get(l);
ret = so_clicked(inst, event, timestamp, x, y);
- if (ret < 0)
+ if (ret < 0) {
return ret;
+ }
if (ret & NEED_TO_SCHEDULE) {
DbgPrint("%s Returns NEED_TO_SCHEDULE\n", pkgname);
(void)append_pending_list(item);
}
- if (ret & OUTPUT_UPDATED)
+ if (ret & OUTPUT_UPDATED) {
update_monitor_cnt(item);
+ }
return LB_STATUS_SUCCESS;
}
if (!strcmp(emission, "lb,show")) {
item->is_lb_show = 1;
- if (item->is_lb_updated && !is_pended_item(item))
+ if (item->is_lb_updated && !is_pended_item(item)) {
reset_lb_updated_flag(item);
+ }
source = util_uri_to_path(source);
} else if (!strcmp(emission, "lb,hide")) {
}
ret = so_script_event(inst, emission, source, event_info);
- if (ret < 0)
+ if (ret < 0) {
return ret;
+ }
if (ret & NEED_TO_SCHEDULE) {
DbgPrint("%s Returns NEED_TO_SCHEDULE\n", pkgname);
(void)append_pending_list(item);
}
- if (ret & OUTPUT_UPDATED)
+ if (ret & OUTPUT_UPDATED) {
update_monitor_cnt(item);
+ }
return LB_STATUS_SUCCESS;
}
item = eina_list_data_get(l);
ret = so_change_group(inst, cluster, category);
- if (ret < 0)
+ if (ret < 0) {
return ret;
+ }
if (ret & NEED_TO_SCHEDULE) {
DbgPrint("%s Returns NEED_TO_SCHEDULE\n", pkgname);
(void)append_pending_list(item);
}
- if (ret & OUTPUT_UPDATED)
+ if (ret & OUTPUT_UPDATED) {
update_monitor_cnt(item);
+ }
return LB_STATUS_SUCCESS;
}
-static inline int lb_sys_event(struct instance *inst, struct item *item, int event)
+static int lb_sys_event(struct instance *inst, struct item *item, int event)
{
int ret;
ret = so_sys_event(inst, event);
- if (ret < 0)
+ if (ret < 0) {
return ret;
+ }
- if (ret & NEED_TO_SCHEDULE)
+ if (ret & NEED_TO_SCHEDULE) {
(void)append_pending_list(item);
+ }
- if (ret & OUTPUT_UPDATED)
+ if (ret & OUTPUT_UPDATED) {
update_monitor_cnt(item);
+ }
return LB_STATUS_SUCCESS;
}
DbgPrint("Update content for %s\n", pkgname ? pkgname : "(all)");
EINA_LIST_FOREACH_SAFE(s_info.item_list, l, n, item) {
- if (item->deleteme)
+ if (item->deleteme) {
continue;
+ }
- if (cluster && strcasecmp(item->inst->cluster, cluster))
+ if (cluster && strcasecmp(item->inst->cluster, cluster)) {
continue;
+ }
- if (category && strcasecmp(item->inst->category, category))
+ if (category && strcasecmp(item->inst->category, category)) {
continue;
+ }
if (pkgname && strlen(pkgname)) {
if (!strcmp(item->inst->item->pkgname, pkgname)) {
int cnt = 0;
EINA_LIST_FOREACH_SAFE(s_info.item_list, l, n, item) {
- if (!item->deleteme)
+ if (!item->deleteme) {
continue;
+ }
update_monitor_del(item->inst->id, item);
(void)so_destroy(item->inst);
struct item *item;
EINA_LIST_FOREACH_SAFE(s_info.item_list, l, n, item) {
- if (item->deleteme)
+ if (item->deleteme) {
continue;
+ }
DbgPrint("System event for %s (%d)\n", item->inst->id, event);
lb_sys_event(item->inst, item, event);
continue;
}
- if (item->is_paused)
+ if (item->is_paused) {
continue;
+ }
timer_freeze(item);
continue;
}
- if (item->is_paused)
+ if (item->is_paused) {
continue;
+ }
lb_sys_event(item->inst, item, LB_SYS_EVENT_RESUMED);
struct item *item;
inst = so_find_instance(pkgname, id);
- if (!inst)
+ if (!inst) {
return LB_STATUS_ERROR_INVALID;
+ }
l = find_item(inst);
if (!l) {
}
item = eina_list_data_get(l);
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_FAULT;
+ }
if (item->deleteme) {
DbgPrint("Instance %s will be deleted (%s)\n", item->inst->item->pkgname, item->inst->id);
item->is_paused = 1;
- if (s_info.paused)
+ if (s_info.paused) {
return LB_STATUS_SUCCESS;
+ }
timer_freeze(item);
int ret;
inst = so_find_instance(pkgname, id);
- if (!inst)
+ if (!inst) {
return LB_STATUS_ERROR_INVALID;
+ }
l = find_item(inst);
if (!l) {
}
item = eina_list_data_get(l);
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_FAULT;
+ }
if (item->deleteme) {
DbgPrint("Instance %s will be deleted (%s)\n", item->inst->item->pkgname, item->inst->id);
item->is_paused = 0;
- if (s_info.paused)
+ if (s_info.paused) {
return LB_STATUS_SUCCESS;
+ }
lb_sys_event(inst, item, LB_SYS_EVENT_RESUMED);
{
int size;
- if (system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &size) != SYSTEM_SETTINGS_ERROR_NONE)
+ if (system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &size) != SYSTEM_SETTINGS_ERROR_NONE) {
return;
+ }
size = convert_font_size(size);
static void time_changed_cb(keynode_t *node, void *user_data)
{
- if (vconf_keynode_get_int(node) != VCONFKEY_SYSMAN_STIME_CHANGED)
+ if (vconf_keynode_get_int(node) != VCONFKEY_SYSMAN_STIME_CHANGED) {
return;
+ }
DbgPrint("Time is changed\n");
lb_system_event_all(LB_SYS_EVENT_TIME_CHANGED);
ret = conf_loader();
DbgPrint("Configureation manager is initiated: %d\n", ret);
- if (COM_CORE_THREAD)
- setenv("PROVIDER_COM_CORE_THREAD", "true", 0);
- else
- setenv("PROVIDER_COM_CORE_THREAD", "false", 0);
+ if (COM_CORE_THREAD) {
+ if (setenv("PROVIDER_COM_CORE_THREAD", "true", 0) < 0) {
+ ErrPrint("setenv: %s\n", strerror(errno));
+ }
+ } else {
+ if (setenv("PROVIDER_COM_CORE_THREAD", "false", 0) < 0){
+ ErrPrint("setenv: %s\n", strerror(errno));
+ }
+ }
ret = livebox_service_init();
DbgPrint("Livebox service init: %d\n", ret);
mcheck(mcheck_cb);
#endif
option = getenv("PROVIDER_DISABLE_CALL_OPTION");
- if (option && !strcasecmp(option, "true"))
+ if (option && !strcasecmp(option, "true")) {
fault_disable_call_option();
+ }
option = getenv("PROVIDER_HEAP_MONITOR_START");
- if (option && !strcasecmp(option, "true"))
+ if (option && !strcasecmp(option, "true")) {
s_info.heap_monitor = 1;
+ }
setenv("BUFMGR_LOCK_TYPE", "once", 0);
setenv("BUFMGR_MAP_CACHE", "true", 0);
struct so_item *item;
EINA_LIST_FOREACH(s_info.livebox_list, l, item) {
- if (!strcmp(item->pkgname, pkgname))
+ if (!strcmp(item->pkgname, pkgname)) {
return item;
+ }
}
return NULL;
}
heap_monitor_del_target(item->so_fname);
- dlclose(item->handle);
+ if (dlclose(item->handle) != 0) {
+ ErrPrint("dlclose: %s\n", dlerror());
+ }
free(item->so_fname);
free(item->pkgname);
free(item);
static struct so_item *new_adaptor(const char *pkgname, const char *abi)
{
struct so_item *item;
+ char *errmsg;
item = calloc(1, sizeof(*item));
if (!item) {
}
fault_unmark_call(pkgname, __func__, __func__, USE_ALARM);
+ errmsg = dlerror();
+ if (errmsg) {
+ DbgPrint("dlerror(can be ignored): %s\n", errmsg);
+ }
+
item->adaptor.create = (adaptor_create_t)dlsym(item->handle, "livebox_create");
if (!item->adaptor.create) {
ErrPrint("symbol: livebox_create - %s\n", dlerror());
}
item->adaptor.pinup = (adaptor_pinup_t)dlsym(item->handle, "livebox_pinup");
- if (!item->adaptor.pinup)
+ if (!item->adaptor.pinup) {
ErrPrint("symbol: livebox_pinup - %s\n", dlerror());
+ }
item->adaptor.is_updated = (adaptor_is_updated_t)dlsym(item->handle, "livebox_need_to_update");
- if (!item->adaptor.is_updated)
+ if (!item->adaptor.is_updated) {
ErrPrint("symbol: livebox_need_to_update - %s\n", dlerror());
+ }
item->adaptor.update_content = (adaptor_update_content_t)dlsym(item->handle, "livebox_update_content");
- if (!item->adaptor.update_content)
+ if (!item->adaptor.update_content) {
ErrPrint("symbol: livebox_update_content - %s\n", dlerror());
+ }
item->adaptor.clicked = (adaptor_clicked_t)dlsym(item->handle, "livebox_clicked");
- if (!item->adaptor.clicked)
+ if (!item->adaptor.clicked) {
ErrPrint("symbol: livebox_clicked - %s\n", dlerror());
+ }
item->adaptor.script_event = (adaptor_script_t)dlsym(item->handle, "livebox_content_event");
- if (!item->adaptor.script_event)
+ if (!item->adaptor.script_event) {
ErrPrint("symbol: livebox_content_event - %s\n", dlerror());
+ }
item->adaptor.resize = (adaptor_resize_t)dlsym(item->handle, "livebox_resize");
- if (!item->adaptor.resize)
+ if (!item->adaptor.resize) {
ErrPrint("symbol: livebox_resize - %s\n", dlerror());
+ }
item->adaptor.create_needed = (adaptor_create_needed_t)dlsym(item->handle, "livebox_need_to_create");
- if (!item->adaptor.create_needed)
+ if (!item->adaptor.create_needed) {
ErrPrint("symbol: livebox_need_to_create - %s\n", dlerror());
+ }
item->adaptor.change_group = (adaptor_change_group_t)dlsym(item->handle, "livebox_change_group");
- if (!item->adaptor.change_group)
+ if (!item->adaptor.change_group) {
ErrPrint("symbol: livebox_change_group - %s\n", dlerror());
+ }
item->adaptor.get_output_info = (adaptor_get_output_info_t)dlsym(item->handle, "livebox_get_info");
- if (!item->adaptor.get_output_info)
+ if (!item->adaptor.get_output_info) {
ErrPrint("symbol: livebox_get_info - %s\n", dlerror());
+ }
item->adaptor.initialize = (adaptor_initialize_t)dlsym(item->handle, "livebox_initialize");
- if (!item->adaptor.initialize)
+ if (!item->adaptor.initialize) {
ErrPrint("symbol: livebox_initialize - %s\n", dlerror());
+ }
item->adaptor.finalize = (adaptor_finalize_t)dlsym(item->handle, "livebox_finalize");
- if (!item->adaptor.finalize)
+ if (!item->adaptor.finalize) {
ErrPrint("symbol: livebox_finalize - %s\n", dlerror());
+ }
item->adaptor.need_to_destroy = (adaptor_need_to_destroy_t)dlsym(item->handle, "livebox_need_to_destroy");
- if (!item->adaptor.need_to_destroy)
+ if (!item->adaptor.need_to_destroy) {
ErrPrint("symbol: livebox_need_to_destroy - %s\n", dlerror());
+ }
item->adaptor.sys_event = (adaptor_system_event_t)dlsym(item->handle, "livebox_system_event");
- if (!item->adaptor.sys_event)
+ if (!item->adaptor.sys_event) {
ErrPrint("symbol: lievbox_system_event - %s\n", dlerror());
+ }
item->adaptor.is_pinned_up = (adaptor_is_pinned_up_t)dlsym(item->handle, "livebox_is_pinned_up");
- if (!item->adaptor.is_pinned_up)
+ if (!item->adaptor.is_pinned_up) {
ErrPrint("symbol: livebox_is_pinned_up - %s\n", dlerror());
+ }
if (item->adaptor.initialize) {
int ret;
static struct so_item *new_livebox(const char *pkgname)
{
struct so_item *item;
+ char *errmsg;
item = calloc(1, sizeof(*item));
if (!item) {
}
fault_unmark_call(pkgname, __func__, __func__, USE_ALARM);
+ errmsg = dlerror();
+ if (errmsg) {
+ DbgPrint("dlerror(can be ignored): %s\n", errmsg);
+ }
+
item->livebox.create = (create_t)dlsym(item->handle, "livebox_create");
if (!item->livebox.create) {
ErrPrint("symbol: livebox_create - %s\n", dlerror());
}
item->livebox.pinup = (pinup_t)dlsym(item->handle, "livebox_pinup");
- if (!item->livebox.pinup)
+ if (!item->livebox.pinup) {
ErrPrint("symbol: livebox_pinup - %s\n", dlerror());
+ }
item->livebox.is_updated = (is_updated_t)dlsym(item->handle, "livebox_need_to_update");
- if (!item->livebox.is_updated)
+ if (!item->livebox.is_updated) {
ErrPrint("symbol: livebox_need_to_update - %s\n", dlerror());
+ }
item->livebox.update_content = (update_content_t)dlsym(item->handle, "livebox_update_content");
- if (!item->livebox.update_content)
+ if (!item->livebox.update_content) {
ErrPrint("symbol: livebox_update_content - %s\n", dlerror());
+ }
item->livebox.clicked = (clicked_t)dlsym(item->handle, "livebox_clicked");
- if (!item->livebox.clicked)
+ if (!item->livebox.clicked) {
ErrPrint("symbol: livebox_clicked - %s\n", dlerror());
+ }
item->livebox.script_event = (script_t)dlsym(item->handle, "livebox_content_event");
- if (!item->livebox.script_event)
+ if (!item->livebox.script_event) {
ErrPrint("symbol: livebox_content_event - %s\n", dlerror());
+ }
item->livebox.resize = (resize_t)dlsym(item->handle, "livebox_resize");
- if (!item->livebox.resize)
+ if (!item->livebox.resize) {
ErrPrint("symbol: livebox_resize - %s\n", dlerror());
+ }
item->livebox.create_needed = (create_needed_t)dlsym(item->handle, "livebox_need_to_create");
- if (!item->livebox.create_needed)
+ if (!item->livebox.create_needed) {
ErrPrint("symbol: livebox_need_to_create - %s\n", dlerror());
+ }
item->livebox.change_group = (change_group_t)dlsym(item->handle, "livebox_change_group");
- if (!item->livebox.change_group)
+ if (!item->livebox.change_group) {
ErrPrint("symbol: livebox_change_group - %s\n", dlerror());
+ }
item->livebox.get_output_info = (get_output_info_t)dlsym(item->handle, "livebox_get_info");
- if (!item->livebox.get_output_info)
+ if (!item->livebox.get_output_info) {
ErrPrint("symbol: livebox_get_info - %s\n", dlerror());
+ }
item->livebox.initialize = (initialize_t)dlsym(item->handle, "livebox_initialize");
- if (!item->livebox.initialize)
+ if (!item->livebox.initialize) {
ErrPrint("symbol: livebox_initialize - %s\n", dlerror());
+ }
item->livebox.finalize = (finalize_t)dlsym(item->handle, "livebox_finalize");
- if (!item->livebox.finalize)
+ if (!item->livebox.finalize) {
ErrPrint("symbol: livebox_finalize - %s\n", dlerror());
+ }
item->livebox.need_to_destroy = (need_to_destroy_t)dlsym(item->handle, "livebox_need_to_destroy");
- if (!item->livebox.need_to_destroy)
+ if (!item->livebox.need_to_destroy) {
ErrPrint("symbol: livebox_need_to_destroy - %s\n", dlerror());
+ }
item->livebox.sys_event = (system_event_t)dlsym(item->handle, "livebox_system_event");
- if (!item->livebox.sys_event)
+ if (!item->livebox.sys_event) {
ErrPrint("symbol: livebox_system_event - %s\n", dlerror());
+ }
item->livebox.is_pinned_up = (is_pinned_up_t)dlsym(item->handle, "livebox_is_pinned_up");
- if (!item->livebox.is_pinned_up)
+ if (!item->livebox.is_pinned_up) {
ErrPrint("symbol: livebox_is_pinned_up - %s\n", dlerror());
+ }
heap_monitor_add_target(item->so_fname);
Eina_List *l;
EINA_LIST_FOREACH(item->inst_list, l, inst) {
- if (!strcmp(inst->id, id))
+ if (!strcmp(inst->id, id)) {
return inst;
+ }
}
return NULL;
struct so_item *item;
item = find_livebox(pkgname);
- if (!item)
+ if (!item) {
return NULL;
+ }
return find_instance(item, id);
}
return LB_STATUS_ERROR_EXIST;
}
} else {
- if (!strcasecmp(abi, "c"))
+ if (!strcasecmp(abi, "c")) {
item = new_livebox(pkgname);
- else
+ } else {
item = new_adaptor(pkgname, abi);
- if (!item)
+ }
+
+ if (!item) {
return LB_STATUS_ERROR_FAULT;
+ }
}
inst = new_instance(id, content_info, cluster, category);
if (!inst) {
- if (!item->inst_list)
+ if (!item->inst_list) {
delete_livebox(item);
+ }
return LB_STATUS_ERROR_FAULT;
}
fault_mark_call(pkgname, id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_CREATE;
- if (item->adaptor.create)
+ if (item->adaptor.create) {
ret = item->adaptor.create(pkgname, util_uri_to_path(id), content_info, cluster, category);
- else if (item->livebox.create)
+ } else if (item->livebox.create) {
ret = item->livebox.create(util_uri_to_path(id), content_info, cluster, category);
- else /*! \NOTE: This is not possible, but for the exceptional handling */
+ } else { /*! \NOTE: This is not possible, but for the exceptional handling */
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(pkgname, id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_DESTROY;
- if (item->adaptor.destroy)
+ if (item->adaptor.destroy) {
ret = item->adaptor.destroy(item->pkgname, util_uri_to_path(inst->id));
- else if (item->livebox.destroy)
+ } else if (item->livebox.destroy) {
ret = item->livebox.destroy(util_uri_to_path(inst->id));
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
char *ret;
item = inst->item;
- if (!item)
+ if (!item) {
return NULL;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_PINUP;
- if (item->adaptor.pinup)
+ if (item->adaptor.pinup) {
ret = item->adaptor.pinup(item->pkgname, util_uri_to_path(inst->id), pinup);
- else if (item->livebox.pinup)
+ } else if (item->livebox.pinup) {
ret = item->livebox.pinup(util_uri_to_path(inst->id), pinup);
- else
+ } else {
ret = NULL;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_IS_PINNED_UP;
- if (item->adaptor.is_pinned_up)
+ if (item->adaptor.is_pinned_up) {
ret = item->adaptor.is_pinned_up(item->pkgname, util_uri_to_path(inst->id));
- else if (item->livebox.is_pinned_up)
+ } else if (item->livebox.is_pinned_up) {
ret = item->livebox.is_pinned_up(util_uri_to_path(inst->id));
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_NEED_TO_UPDATE;
- if (item->adaptor.is_updated)
+ if (item->adaptor.is_updated) {
ret = item->adaptor.is_updated(item->pkgname, util_uri_to_path(inst->id));
- else if (item->livebox.is_updated)
+ } else if (item->livebox.is_updated) {
ret = item->livebox.is_updated(util_uri_to_path(inst->id));
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_NEED_TO_DESTROY;
- if (item->adaptor.need_to_destroy)
+ if (item->adaptor.need_to_destroy) {
ret = item->adaptor.need_to_destroy(item->pkgname, util_uri_to_path(inst->id));
- else if (item->livebox.need_to_destroy)
+ } else if (item->livebox.need_to_destroy) {
ret = item->livebox.need_to_destroy(util_uri_to_path(inst->id));
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_UPDATE_CONTENT;
- if (item->adaptor.update_content)
+ if (item->adaptor.update_content) {
ret = item->adaptor.update_content(item->pkgname, util_uri_to_path(inst->id));
- else if (item->livebox.update_content)
+ } else if (item->livebox.update_content) {
ret = item->livebox.update_content(util_uri_to_path(inst->id));
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
DbgPrint("PERF_DBOX\n");
s_info.current_op = LIVEBOX_OP_CLICKED;
- if (item->adaptor.clicked)
+ if (item->adaptor.clicked) {
ret = item->adaptor.clicked(item->pkgname, util_uri_to_path(inst->id), event, timestamp, x, y);
- else if (item->livebox.clicked)
+ } else if (item->livebox.clicked) {
ret = item->livebox.clicked(util_uri_to_path(inst->id), event, timestamp, x, y);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_CONTENT_EVENT;
- if (item->adaptor.script_event)
+ if (item->adaptor.script_event) {
ret = item->adaptor.script_event(item->pkgname, util_uri_to_path(inst->id), emission, source, event_info);
- else if (item->livebox.script_event)
+ } else if (item->livebox.script_event) {
ret = item->livebox.script_event(util_uri_to_path(inst->id), emission, source, event_info);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int type;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
type = livebox_service_size_type(w, h);
- if (type == LB_SIZE_TYPE_UNKNOWN)
+ if (type == LB_SIZE_TYPE_UNKNOWN) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_RESIZE;
- if (item->adaptor.resize)
+ if (item->adaptor.resize) {
ret = item->adaptor.resize(item->pkgname, util_uri_to_path(inst->id), type);
- else if (item->livebox.resize)
+ } else if (item->livebox.resize) {
ret = item->livebox.resize(util_uri_to_path(inst->id), type);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
item = find_livebox(pkgname);
if (!item) {
- if (!strcasecmp(abi, "c"))
+ if (!strcasecmp(abi, "c")) {
item = new_livebox(pkgname);
- else
+ } else {
item = new_adaptor(pkgname, abi);
- if (!item)
+ }
+
+ if (!item) {
return LB_STATUS_ERROR_FAULT;
+ }
}
fault_mark_call(item->pkgname, __func__, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_NEED_TO_CREATE;
- if (item->adaptor.create_needed)
+ if (item->adaptor.create_needed) {
ret = item->adaptor.create_needed(pkgname, cluster, category);
- else if (item->livebox.create_needed)
+ } else if (item->livebox.create_needed) {
ret = item->livebox.create_needed(cluster, category);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, __func__, __func__, USE_ALARM);
char *tmp_category;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
tmp_cluster = strdup(cluster);
- if (!tmp_cluster)
+ if (!tmp_cluster) {
return LB_STATUS_ERROR_MEMORY;
+ }
tmp_category = strdup(category);
if (!tmp_category) {
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_CHANGE_GROUP;
- if (item->adaptor.change_group)
+ if (item->adaptor.change_group) {
ret = item->adaptor.change_group(item->pkgname, util_uri_to_path(inst->id), cluster, category);
- else if (item->livebox.change_group)
+ } else if (item->livebox.change_group) {
ret = item->livebox.change_group(util_uri_to_path(inst->id), cluster, category);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
*content = NULL;
*title = NULL;
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_GET_INFO;
- if (item->adaptor.get_output_info)
+ if (item->adaptor.get_output_info) {
ret = item->adaptor.get_output_info(item->pkgname, util_uri_to_path(inst->id), w, h, priority, content, title);
- else if (item->livebox.get_output_info)
+ } else if (item->livebox.get_output_info) {
ret = item->livebox.get_output_info(util_uri_to_path(inst->id), w, h, priority, content, title);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
}
}
- if (main_heap_monitor_is_enabled())
+ if (main_heap_monitor_is_enabled()) {
DbgPrint("%s allocates %d bytes\n", item->pkgname, heap_monitor_target_usage(item->so_fname));
+ }
return ret;
}
int ret;
item = inst->item;
- if (!item)
+ if (!item) {
return LB_STATUS_ERROR_INVALID;
+ }
fault_mark_call(item->pkgname, inst->id, __func__, USE_ALARM, DEFAULT_LIFE_TIMER);
s_info.current_op = LIVEBOX_OP_SYSTEM_EVENT;
- if (item->adaptor.sys_event)
+ if (item->adaptor.sys_event) {
ret = item->adaptor.sys_event(item->pkgname, util_uri_to_path(inst->id), event);
- else if (item->livebox.sys_event)
+ } else if (item->livebox.sys_event) {
ret = item->livebox.sys_event(util_uri_to_path(inst->id), event);
- else
+ } else {
ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
+ }
s_info.current_op = LIVEBOX_OP_UNKNOWN;
fault_unmark_call(item->pkgname, inst->id, __func__, USE_ALARM);
if (util_check_ext(evt->name, "gnp.") == 0
&& util_check_ext(evt->name, "csed.") == 0)
+ {
continue;
+ }
len = strlen(evt->name) + strlen(IMAGE_PATH) + 1;
filename = malloc(len);
if (s_info.iwd < 0) {
ErrPrint("Error: %s\n", strerror(errno));
- close(s_info.ifd);
+ if (close(s_info.ifd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
s_info.ifd = LB_STATUS_ERROR_INVALID;
return LB_STATUS_ERROR_IO;
}
ECORE_FD_READ, monitor_cb, NULL, NULL, NULL);
if (!s_info.handler) {
ErrPrint("Failed to add a FD handler\n");
- if (inotify_rm_watch(s_info.ifd, s_info.iwd) < 0)
+ if (inotify_rm_watch(s_info.ifd, s_info.iwd) < 0) {
ErrPrint("inotify_rm_watch: %s", strerror(errno));
+ }
s_info.iwd = -EINVAL;
- close(s_info.ifd);
+ if (close(s_info.ifd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
s_info.ifd = LB_STATUS_ERROR_INVALID;
return LB_STATUS_ERROR_FAULT;
}
}
if (s_info.ifd >= 0) {
- if (inotify_rm_watch(s_info.ifd, s_info.iwd) < 0)
+ if (inotify_rm_watch(s_info.ifd, s_info.iwd) < 0) {
ErrPrint("inotify_rm_watch:%s", strerror(errno));
+ }
s_info.iwd = LB_STATUS_ERROR_INVALID;
- close(s_info.ifd);
+ if (close(s_info.ifd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
s_info.ifd = LB_STATUS_ERROR_INVALID;
}
int length;
length = name ? strlen(name) : 0;
- if (!length)
+ if (!length) {
return ".";
+ }
while (--length > 0 && name[length] != '/');
register int i;
if (!pthread_getattr_np(pthread_self(), &attr)) {
- if (!pthread_attr_getstack(&attr, (void *)&stack_boundary, &stack_size))
+ if (!pthread_attr_getstack(&attr, (void *)&stack_boundary, &stack_size)) {
stack_boundary += stack_size;
+ }
pthread_attr_destroy(&attr);
}
ret = NULL;
for (i = 0, stack = (int *)&stack; (unsigned int)stack < stack_boundary ; stack++, i++) {
- if (!dladdr((void *)*stack, &dinfo))
+ if (!dladdr((void *)*stack, &dinfo)) {
continue;
+ }
ptr = util_basename(dinfo.dli_fname);
if (strncmp(ptr, "liblive-", strlen("liblive-"))) {
ret = strdup(ptr);
if (symbol) {
- if (dinfo.dli_sname)
+ if (dinfo.dli_sname) {
*symbol = strdup(dinfo.dli_sname);
- else
+ } else {
*symbol = NULL;
+ }
}
break;
}
int len;
len = strlen(SCHEMA_FILE);
- if (strncasecmp(uri, SCHEMA_FILE, len))
+ if (strncasecmp(uri, SCHEMA_FILE, len)) {
return NULL;
+ }
return uri + len;
}
return 0.0f;
}
- if (gettimeofday(&tv, NULL) < 0){
+ if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
return period;
}
double delay;
timer = ecore_timer_add(interval, cb, data);
- if (!timer)
+ if (!timer) {
return NULL;
+ }
delay = util_time_delay_for_compensation(interval) - interval;
ecore_timer_delay(timer, delay);