char buf[128] = {0, };
unsigned long cutime, cstime;
int i;
+ int ret = -1;
snprintf(buf, sizeof(buf), "/proc/%d/stat", (int)pid);
fp = fopen(buf, "r");
if (fp) {
retvm_if(fp == NULL, -1, "Failed to open %s\n", buf);
- fscanf(fp, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %lu %lu %ld %ld",
+ ret = fscanf(fp, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %lu %lu %ld %ld",
ut, st, &cutime, &cstime);
+ retvm_if(ret < 0, -1, "Failed to fscanf() \n");
*ut += cutime;
*st += cstime;
fclose(fp);
NULL, NULL);
elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
- item = elm_genlist_item_append(ad->gl, &itc_bl,
- (void *)i, git,
- ELM_GENLIST_ITEM_NONE,
- _bl_sel, (void *)i);
-
item = elm_genlist_item_append(ad->gl, &itc_separator2,
NULL, git,
ELM_GENLIST_ITEM_NONE,
_D("mode(%d) count(%d) pid(%d) \n", ad->mode, ad->endcnt, pid);
if (ret != -1) {
- switch (ad->mode) {
- default:
- case MODE_END_INUSE:
- case MODE_DEL_HISTORY:
- case MODE_DEL_ALL_HISTORY:
- case MODE_KILL_INUSE:
- _D("aa\n");
- _del_popup_timer(ad);
- _del_progressbar(ad);
- refresh_app_info(ad);
- _restart_pthread(ad);
- break;
-
- case MODE_END_ALL_INUSE:
- case MODE_KILL_ALL_INUSE:
- _D("bb\n");
- if (ad->endcnt <= 1) {
- _D("count set 0\n");
+ switch (ad->mode) {
+ default:
+ case MODE_END_INUSE:
+ case MODE_DEL_HISTORY:
+ case MODE_DEL_ALL_HISTORY:
+ case MODE_KILL_INUSE:
+ _D("aa\n");
_del_popup_timer(ad);
_del_progressbar(ad);
refresh_app_info(ad);
_restart_pthread(ad);
+ break;
- } else {
- ad->endcnt--;
+ case MODE_END_ALL_INUSE:
+ case MODE_KILL_ALL_INUSE:
+ _D("bb\n");
+ if (ad->endcnt <= 1) {
+ _D("count set 0\n");
+ _del_popup_timer(ad);
+ _del_progressbar(ad);
+ refresh_app_info(ad);
+ _restart_pthread(ad);
+
+ } else {
+ ad->endcnt--;
+ }
+ break;
}
- break;
}
-}
+
+ return ret;
}
static void _back_cb(void *data, Evas_Object *obj, void *event_info)