char *_appinfo_get_app_path(appinfo_t *menu_info);
int _proc_get_attr_by_pid(int pid, char *buf, int size);
int _close_all_fds(void);
-void _get_cpu_idle(long long *total, long long *idle);
+void _get_cpu_idle(unsigned long long *total, unsigned long long *idle);
int _setup_stdio(const char *ident);
#endif /* __LAUNCHPAD_COMMON_H__ */
char *loader_extra;
int detection_method;
int timeout_val;
- long long cpu_total_time;
- long long cpu_idle_time;
+ unsigned long long cpu_total_time;
+ unsigned long long cpu_idle_time;
guint idle_checker;
} candidate_process_context_t;
static gboolean __handle_idle_checker(gpointer data)
{
- long long total = 0;
- long long idle = 0;
+ unsigned long long total = 0;
+ unsigned long long idle = 0;
int per;
candidate_process_context_t *cpc = data;
{
candidate_process_context_t *cpc;
GList *iter = candidate_slot_list;
- long long total = 0;
- long long idle = 0;
+ unsigned long long total = 0;
+ unsigned long long idle = 0;
_W("cmd hint %d", detection_method);
while (iter) {
candidate_process_context_t *cpc;
bundle_raw *extra = NULL;
int len;
- long long total = 0;
- long long idle = 0;
+ unsigned long long total = 0;
+ unsigned long long idle = 0;
if (!strcmp(info->exe, "null")) {
cpc = __add_slot(LAUNCHPAD_TYPE_USER + user_slot_offset,
return ret;
}
-void _get_cpu_idle(long long *total, long long *idle)
+void _get_cpu_idle(unsigned long long *total, unsigned long long *idle)
{
FILE *fp;
int i;
- long long sum = 0;
- long long val;
- long long iv = 0;
+ unsigned long long sum = 0;
+ unsigned long long val;
+ unsigned long long iv = 0;
char buf[4] = { 0, };
fp = fopen("/proc/stat", "rt");
fclose(fp);
return;
}
+
+ if (sum + val < sum) {
+ _E("overflow");
+ fclose(fp);
+ return;
+ }
+
sum += val;
if (i == 3) /* idle */
iv = val;