hash = bmi->block_exclude_path
? g_hash_table_find(bmi->block_exclude_path,
- find_hash, (gpointer)buf)
+ find_hash, (gpointer)buf)
: NULL;
if (hash) {
bmi->mfd = fanotify_init(FAN_CLOEXEC|FAN_NONBLOCK | FAN_CLASS_CONTENT,
O_RDONLY | O_LARGEFILE | O_CLOEXEC | O_NOATIME);
- if (bmi->mfd< 0) {
+ if (bmi->mfd < 0) {
_E("Failed to create fanotify fd");
goto error;
}
CPU_CONTROL_BANDWIDTH, value);
}
}
- return RESOURCED_ERROR_NONE;
+ return RESOURCED_ERROR_NONE;
}
static int cpu_service_state(void *data)
}
static struct edbus_method edbus_methods[] = {
- { "GetAbnormalData", "ii", "a(si)", edbus_heart_get_abnormal_data },
+ { "GetAbnormalData", "ii", "a(si)", edbus_heart_get_abnormal_data },
};
static int heart_abnormal_init(void *data)
switch (cmd->type) {
case APPOPT_CMD_INSERT:
- if (heart_appopt_db_insert_entry(appopt_db, &cmd->data) != RESOURCED_ERROR_NONE) {
+ if (heart_appopt_db_insert_entry(appopt_db, &cmd->data) != RESOURCED_ERROR_NONE) {
_E("Appopt data insertion failed");
} else {
/* invalidate cache on db update success */
}
break;
case APPOPT_CMD_REMOVE:
- if (heart_appopt_db_remove_entry(appopt_db, &cmd->data) != RESOURCED_ERROR_NONE) {
+ if (heart_appopt_db_remove_entry(appopt_db, &cmd->data) != RESOURCED_ERROR_NONE) {
_E("Query execution failed");
} else {
/* invalidate cache on db remove success */
{
int i;
- for(i = 0; i < BATTERY_HISTORY_RESET_MAX; i++) {
+ for (i = 0; i < BATTERY_HISTORY_RESET_MAX; i++) {
if (heart_battery_get_usage_reset_count(i, DISCHARGING) < BATTERY_HISTORY_COUNT_MAX
&& heart_battery_get_usage_reset_count(i, CHARGING) < BATTERY_HISTORY_COUNT_MAX)
return i;
batt_used.used_time_sec = 0;
batt_used.last_update_time = logging_get_time(CLOCK_BOOTTIME);
- return RESOURCED_ERROR_NONE;
+ return RESOURCED_ERROR_NONE;
}
static long heart_battery_compute_remaining_time_in_min(int capacity_count, long sec_per_cap)
GSList *iter, *next;
struct heart_battery_capacity *lbc;
- heart_battery_save_to_file(true);
+ heart_battery_save_to_file(true);
ret = pthread_mutex_lock(&heart_battery_mutex);
if (ret) {
_E("pthread_mutex_lock() failed, %d", ret);
time_t curr_time = logging_get_time(CLOCK_BOOTTIME);
struct heart_cpu_table *table;
struct heart_cpu_info *ci = NULL;
- GHashTable *cpu_usage_list = NULL;
+ GHashTable *cpu_usage_list = NULL;
if (user_data)
cpu_usage_list = (GHashTable *)user_data;
heart_cpu_update_app_list(NULL);
- logging_save_to_storage(true);
+ logging_save_to_storage(true);
/* update data list from db */
logging_update(true);
do {
fprintf(stdout, "Try to allocate memory %zu", len);
p = new0(void, len);
- } while(!p);
+ } while (!p);
r = mlock(p, len);
if (r < 0) {
return r;
}
- while(!quite)
+ while (!quite)
sleep(10);
r = mem_stress_free_memory(mem, arg_size);
static int memps_file_select(const struct dirent *entry)
{
- return strstr(entry->d_name, "memps") ? 1 : 0;
+ return strstr(entry->d_name, "memps") ? 1 : 0;
}
static void clear_logs(char *dir)
static int compare_victims_point(const struct task_info *ta, const struct task_info *tb)
{
- unsigned int pa, pb;
+ unsigned int pa, pb;
assert(ta != NULL);
assert(tb != NULL);
if (!swap) {
swap = find_module("swap");
- if(!swap)
+ if (!swap)
return;
}
static int memory_load_64_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory64", result);
+ return set_memory_config("Memory64", result);
}
static int memory_load_256_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory256", result);
+ return set_memory_config("Memory256", result);
}
static int memory_load_448_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory448", result);
+ return set_memory_config("Memory448", result);
}
static int memory_load_512_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory512", result);
+ return set_memory_config("Memory512", result);
}
static int memory_load_768_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory768", result);
+ return set_memory_config("Memory768", result);
}
static int memory_load_1024_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory1024", result);
+ return set_memory_config("Memory1024", result);
}
static int memory_load_2048_config(struct parse_result *result, void *user_data)
{
- return set_memory_config("Memory2048", result);
+ return set_memory_config("Memory2048", result);
}
/* setup memcg parameters depending on total ram size. */
static int allocate_vip_app_list(void)
{
vip_apps = g_ptr_array_new();
- if(!vip_apps) {
+ if (!vip_apps) {
_E("g_ptr_array_new : out of memory");
return RESOURCED_ERROR_OUT_OF_MEMORY;
}
static void free_vip_app_list(void)
{
- if(vip_apps) {
+ if (vip_apps) {
g_ptr_array_foreach(vip_apps, (GFunc)g_free, NULL);
g_ptr_array_free(vip_apps, true);
vip_apps = NULL;
init_memcg_params();
setup_memcg_params();
- if(allocate_vip_app_list() != RESOURCED_ERROR_NONE)
+ if (allocate_vip_app_list() != RESOURCED_ERROR_NONE)
_E("allocate_vip_app_list FAIL");
- if(config_parse(MEM_CONF_FILE, load_vip_config, NULL))
+ if (config_parse(MEM_CONF_FILE, load_vip_config, NULL))
_E("(%s) parse Fail", MEM_CONF_FILE);
- if(set_vip_list() != RESOURCED_ERROR_NONE)
+ if (set_vip_list() != RESOURCED_ERROR_NONE)
_E("set_vip_list FAIL");
/* vip_list is only needed at the set_vip_list */
* above threshold_leave
*/
if (after >= memcg_root->threshold[LOWMEM_MEDIUM])
- return RESOURCED_ERROR_FAIL;
+ return RESOURCED_ERROR_FAIL;
should_be_freed = memcg_root->threshold_leave +
THRESHOLD_MARGIN - after;
_D("run history based proactive killer, should_be_freed = %u MB",
- should_be_freed);
+ should_be_freed);
lowmem_force_oom_killer(OOM_FORCE, should_be_freed, num_max_victims);
return RESOURCED_ERROR_NONE;
threshold_part = _get_threshold_part(time_period);
- return (get_quota_ceiling(quota) / 100 ) * threshold_part;
+ return (get_quota_ceiling(quota) / 100) * threshold_part;
}
static dbus_bool_t deserialize_quota(
goto release;
}
- if(quota->iftype <= RESOURCED_IFACE_UNKNOWN ||
+ if (quota->iftype <= RESOURCED_IFACE_UNKNOWN ||
quota->iftype >= RESOURCED_IFACE_LAST_ELEM) {
_E("Unknown network interface is inacceptable!");
ret = FALSE;
if (quota->roaming_type < RESOURCED_ROAMING_UNKNOWN ||
quota->roaming_type >= RESOURCED_ROAMING_LAST_ELEM ||
(quota->roaming_type == RESOURCED_ROAMING_UNKNOWN &&
- quota->iftype == RESOURCED_IFACE_DATACALL))
- {
+ quota->iftype == RESOURCED_IFACE_DATACALL)) {
_E("Bad roaming!");
ret = FALSE;
goto release;
resourced_state_t ground; /* background/foreground state */
};
-struct ground_state_info{
+struct ground_state_info {
struct counter_arg *carg;
u_int32_t classid;
resourced_state_t state;
#endif /* CONFIG_DATAUSAGE_NFACCT */
static gboolean bg_restriction(gpointer key, gpointer value,
- gpointer data)
+ gpointer data)
{
bool *bg_restriction = (bool *)data;
nf_value = lookup_counter(counter);
- ret_value_msg_if (!nf_value, FALSE, "Can't remove counter, due it's not in tree");
+ ret_value_msg_if(!nf_value, FALSE, "Can't remove counter, due it's not in tree");
SET_BIT(nf_value->fini, NFACCT_FINAL_REMOVE);
/* move it into _answer_func_cb */
for_each_ifnames((ifnames_iterator)remove_each_counter, NULL, &counter);
}
-struct match_nftree_context
-{
+struct match_nftree_context {
u_int32_t classid;
pid_t pid;
};
{
struct nfacct_value *nf_value = (struct nfacct_value *)value;
struct nfacct_key *nf_key = (struct nfacct_key *)key;
- resourced_state_t state = (resourced_state_t )data;
+ resourced_state_t state = (resourced_state_t)data;
struct proc_app_info *pai = NULL;
resourced_restriction_info rst_info = {0};
char *app_id;
return FALSE;
}
-static void add_tizen_os_counters(struct counter_arg *carg) {
-
+static void add_tizen_os_counters(struct counter_arg *carg)
+{
for_each_ifnames((ifnames_iterator)add_one_tizen_os_counter, NULL, carg);
}
sizeof(struct net_counter_opts));
struct shared_modules_data *m_data = NULL;
- ret_value_msg_if (net_opts == NULL, RESOURCED_ERROR_OUT_OF_MEMORY,
+ ret_value_msg_if(net_opts == NULL, RESOURCED_ERROR_OUT_OF_MEMORY,
"Not enough memory");
m_data = get_shared_modules_data();
#ifdef CONFIG_DATAUSAGE_NFACCT
static int compare_nfcntr(gconstpointer a, gconstpointer b,
- gpointer UNUSED user_data)
+ gpointer UNUSED user_data)
{
struct nfacct_key *key_a = (struct nfacct_key *)a;
struct nfacct_key *key_b = (struct nfacct_key *)b;
ret_msg_if(!value->iptables_rule, "There is no iptables_rule handler");
ret = value->iptables_rule(counter);
- ret_msg_if (ret != RESOURCED_ERROR_NONE, "Failed to execute iptables rule");
+ ret_msg_if(ret != RESOURCED_ERROR_NONE, "Failed to execute iptables rule");
UNSET_BIT(value->fini, NFACCT_FINAL_REMOVE);
value->state = NFACCT_STATE_DEACTIVATED;
#ifdef NETWORK_DEBUG_ENABLED
if (nf_key->iotype == NFACCT_COUNTER_IN)
info->rcv_limit = nf_value->quota;
- else if(nf_key->iotype == NFACCT_COUNTER_OUT)
+ else if (nf_key->iotype == NFACCT_COUNTER_OUT)
info->send_limit = nf_value->quota;
else
_D("Unknown iotype");
(counter->state != NFACCT_STATE_ACTIVE)) {
ret = ctx->counter->iptables_rule(ctx->counter);
ret_value_msg_if(ret != RESOURCED_ERROR_NONE, RESOURCED_ERROR_FAIL,
- "Can't add iptables ingress rule");
+ "Can't add iptables ingress rule");
}
return RESOURCED_ERROR_NONE;
}
static bool is_incomplete_counter(struct nfacct_key *nfacct_key,
- struct nfacct_value *nfacct_value)
+ struct nfacct_value *nfacct_value)
{
return nfacct_key->iftype == RESOURCED_IFACE_UNKNOWN &&
nfacct_value->state == NFACCT_STATE_ACTIVE;
* 3. counting is not allowed, e.g. by security reason
*/
static bool check_skip_activating(struct nfacct_key *nfacct_key,
- struct nfacct_value *nfacct_value,
+ struct nfacct_value *nfacct_value,
struct iftype_context *ctx)
{
/**
turn_off_counters(iftype, m_data->carg);
}
-struct del_counter_context
-{
+struct del_counter_context {
struct nfacct_value *nfacct_value;
struct nfacct_key *nfacct_key;
struct counter_arg *carg;
ret = resourced_ipt_remove(&counter, del_ctx->iptc_holder->iptc);
- if(ret != RESOURCED_ERROR_NONE) {
+ if (ret != RESOURCED_ERROR_NONE) {
_E("Can't delete counter %s",
counter.name);
goto finalize_iptc;
}
static inline int _is_period_devisible(const int time_period,
- data_usage_quota_period_t quota_period)
+ data_usage_quota_period_t quota_period)
{
return time_period > quota_period &&
time_period % RESOURCED_PERIOD_MONTH == 0;
}
static void _record_quota(const struct quota_key *key,
- const struct quota *app_quota)
+ const struct quota *app_quota)
{
if (!key || !app_quota) {
_E("Please, provide valid argument.");
const time_t cur_time = time(0);
char buf[30];
- app_id = !strncmp(app_id, RESOURCED_ALL_APP, strlen(RESOURCED_ALL_APP)+1) ? 0: app_id;
+ app_id = !strncmp(app_id, RESOURCED_ALL_APP, strlen(RESOURCED_ALL_APP) + 1) ? 0 : app_id;
if (cur_time < start_time) {
_D("No need to update effective quota!");
rule.iftype = iftype;
if (data_usage_details_foreach(app_id, &rule, data_usage_details_cb,
- &out_context) != RESOURCED_ERROR_NONE) {
+ &out_context) != RESOURCED_ERROR_NONE) {
_E("Cant obtain sent_used_quota/rcv_used_quota");
return;
}
tree_value = find_quota_in_tree(app_id, ser_quota->iftype,
ser_quota->roaming_type,
- ser_quota->imsi_hash, ser_quota->quota_type);
+ ser_quota->imsi_hash, ser_quota->quota_type);
if (!check_event_in_current_modem(ser_quota->imsi_hash,
ser_quota->iftype))
check_and_clear_all_noti();
ser_quota->roaming_type, ser_quota->imsi_hash);
} else if (!tree_value) {
insert_key = malloc(sizeof(struct quota_key));
- ret_msg_if (!insert_key, "not enough memory");
+ ret_msg_if(!insert_key, "not enough memory");
memset(insert_key, 0, sizeof(struct quota_key));
tree_value = (struct quota *)malloc(sizeof(struct quota));
if (!tree_value) {
const char *imsi_hash)
{
struct quota_key key;
- ret_msg_if(!app_id,"app_id must be not NULL");
+ ret_msg_if(!app_id, "app_id must be not NULL");
key.app_id = app_id;
key.iftype = iftype;
return RESOURCED_ERROR_NONE;
if (sqlite3_prepare_v2(resourced_get_database(),
- select_query, -1, &select_stmt,
- NULL) != SQLITE_OK) {
+ select_query, -1, &select_stmt,
+ NULL) != SQLITE_OK) {
_E("Error preparing query: %s, \
%s\n", select_query, sqlite3_errmsg(resourced_get_database()));
goto handle_error;
}
if (sqlite3_prepare_v2(resourced_get_database(),
- insert_query, -1, &insert_stmt,
- NULL) != SQLITE_OK) {
+ insert_query, -1, &insert_stmt,
+ NULL) != SQLITE_OK) {
_E("Error preparing query: %s, \
%s\n", insert_query, sqlite3_errmsg(resourced_get_database()));
goto handle_error;
}
if (sqlite3_prepare_v2(resourced_get_database(),
- clear_effective_quota_query,
- -1, &clear_effective_stmt,
- NULL) != SQLITE_OK) {
+ clear_effective_quota_query,
+ -1, &clear_effective_stmt,
+ NULL) != SQLITE_OK) {
_E("Error preparing query: %s, \
%s\n", clear_effective_quota_query,
sqlite3_errmsg(resourced_get_database()));
static resourced_ret_c load_quotas(void)
{
const resourced_ret_c ret = _init_quotas();
- ret_value_msg_if (ret != RESOURCED_ERROR_NONE, ret, "Failed to init quotas");
+ ret_value_msg_if(ret != RESOURCED_ERROR_NONE, ret, "Failed to init quotas");
return obtain_and_keep_quotas(select_stmt);
}
opts->update_period) ||
app_quota->rcv_warning_threshold < app_quota->rcv_used_quota) &&
(key_quota->roaming == RESOURCED_ROAMING_UNKNOWN ||
- key_quota->roaming == get_current_roaming())){
+ key_quota->roaming == get_current_roaming())) {
data_usage_quota du_quota = {0}; /* use both for
warning/restriction noti */
* is it current imsi or not,
* just do not skip kernel op */
if (proc_keep_restriction(key_quota->app_id,
- app_quota->quota_id, &rst,
+ app_quota->quota_id, &rst,
RST_SET, false, RESOURCED_RESTRICTION_ACTIVATED) != RESOURCED_ERROR_NONE) {
_E("Failed to keep restriction!");
return FALSE;
g_tree_foreach(quotas, check_and_apply_node, (void *)carg);
}
-struct update_all_arg
-{
+struct update_all_arg {
resourced_iface_type iftype;
char *imsi_hash;
struct application_stat *app_stat;
(qkey->roaming == RESOURCED_ROAMING_UNKNOWN ||
qkey->roaming == arg->app_stat->is_roaming) &&
check_ground_state(qkey, arg->app_stat)) ||
- !strncmp(qkey->app_id, TETHERING_APP_NAME, strlen(TETHERING_APP_NAME)+1))
- {
+ !strncmp(qkey->app_id, TETHERING_APP_NAME, strlen(TETHERING_APP_NAME)+1)) {
/* update it */
total_quota->sent_used_quota += arg->app_stat->delta_snd;
total_quota->rcv_used_quota += arg->app_stat->delta_rcv;
/* TODO ground is not handled for quota per application,
* due GUI is not set quota per application, yet,
* no such requirements */
- qkey.imsi_hash = app_key->iftype == RESOURCED_IFACE_DATACALL ? get_imsi_hash(app_key->imsi): "";
+ qkey.imsi_hash = app_key->iftype == RESOURCED_IFACE_DATACALL ? get_imsi_hash(app_key->imsi) : "";
update_traffic_quota(&qkey, &app_stat->delta_snd,
&app_stat->delta_rcv);
return FALSE;
resourced_ret_c get_quota_by_appid(const char* app_id, const char *imsi_hash,
const resourced_iface_type iftype, resourced_roaming_type roaming,
- data_usage_quota *du_quota, int *quota_id, resourced_state_t ground)
+ data_usage_quota *du_quota, int *quota_id, resourced_state_t ground)
{
struct quota *qt;
execute_once {
return RESOURCED_ERROR_INVALID_PARAMETER;
return send_remove_quota_message(rule->app_id, rule->iftype,
- rule->roaming, rule->imsi ? rule->imsi : "", rule->quota_type);
+ rule->roaming, rule->imsi ? rule->imsi : "", rule->quota_type);
}
API resourced_ret_c remove_datausage_quota_by_iftype(
resourced_tm_interval interval;
libresourced_db_initialize_once();
- if (init_datausage_foreach(resourced_get_database())!= SQLITE_OK) {
+ if (init_datausage_foreach(resourced_get_database()) != SQLITE_OK) {
_D("Failed to initialize data usage statements: %s\n",
sqlite3_errmsg(resourced_get_database()));
return RESOURCED_ERROR_DB_FAILED;
resourced_tm_interval interval;
libresourced_db_initialize_once();
- if (init_datausage_foreach(resourced_get_database())!= SQLITE_OK) {
+ if (init_datausage_foreach(resourced_get_database()) != SQLITE_OK) {
_D("Failed to initialize data usage statements: %s\n",
sqlite3_errmsg(resourced_get_database()));
return RESOURCED_ERROR_DB_FAILED;
struct rtattr *multicast_general_family[NESTED_MCAST_MAX + 1] = {0};
fill_attribute_list(multicast_general_family, NESTED_MCAST_MAX,
- rt_na, rt_len);
+ rt_na, rt_len);
/* for each group */
for (i = 0; i < NESTED_MCAST_MAX; ++i) {
}
uint32_t get_family_group_id(int sock, pid_t pid,
- char *family_name, char *group_name,
+ char *family_name, char *group_name,
uint32_t *family_id)
{
struct genl family_req;
char *result = NULL;
if (!ans) {
- _D ("Please provide valid argument!");
+ _D("Please provide valid argument!");
return;
}
GSList *iter;
bool found = false;
struct iface_status *value;
- ret_msg_if (!ifnames_list || !ifname, "Please provide valid argument!");
+ ret_msg_if(!ifnames_list || !ifname, "Please provide valid argument!");
gslist_for_each_item(iter, *ifnames_list) {
struct iface_status *cur = (struct iface_status *)iter->data;
value = (struct iface_status *)malloc(
sizeof(struct iface_status));
- ret_msg_if (!value, "Can't allocate memory for iface_status\n");
+ ret_msg_if(!value, "Can't allocate memory for iface_status\n");
value->active = true; /* we're putting it => it's active now */
value->iftype = iftype;
STRING_SAVE_COPY(value->ifname, ifname);
typedef resourced_cb_ret (*iterate_entries_cb)(struct resourced_ipt_entry_info *info, void *user_data);
-static int find_nfacct_name (const struct xt_entry_match *match,
+static int find_nfacct_name(const struct xt_entry_match *match,
char **found_name)
{
if (match && !strncmp(match->u.user.name, NFACCT_MATCH_NAME, strlen(NFACCT_MATCH_NAME)+1)) {
struct xt_nfacct_match_info *info = (struct xt_nfacct_match_info *)match->data;
- *found_name = info ? info->name: NULL;
+ *found_name = info ? info->name : NULL;
return 1; /* means stop */
}
return 0; /* means continue */
info.rule_type = RESOURCED_OLD_IPT_RULE; /* TODO use enum */
info.entry = (void *)entries + info.offset;
- for (;hook < NF_IP_NUMHOOKS; ++hook) {
+ for (; hook < NF_IP_NUMHOOKS; ++hook) {
if (hook_entry[hook] <= info.offset &&
underflow[hook] > info.offset) {
info.hook = hook;
ret = getsockopt(iptc->sock, IPPROTO_IP, IPT_SO_GET_INFO,
iptc->info, &s);
- if(ret < 0) {
+ if (ret < 0) {
_E("iptables support missing error %d (%s)", errno,
strerror_r(errno, error_buf, sizeof(error_buf)));
goto release_info;
r->size = replace_size;
/* xt_counters from linux/netfilter/x_ipts.h */
- r->counters = (struct xt_counters *)malloc(sizeof(struct xt_counters)
- * iptc->old_entries);
+ r->counters = (struct xt_counters *)malloc(sizeof(struct xt_counters) *
+ iptc->old_entries);
if (!r->counters) {
free(r);
_E("Not enough memory");
dest_ifname = entry->ip.iniface;
dest_ifmask = entry->ip.iniface_mask;
/* iface_flag = IPT_INV_VIA_IN;*/
- }
- else if (rule->iotype == NFACCT_COUNTER_OUT) {
+ } else if (rule->iotype == NFACCT_COUNTER_OUT) {
dest_ifname = entry->ip.outiface;
dest_ifmask = entry->ip.outiface_mask;
/* iface_flag = IPT_INV_VIA_OUT;*/
{
if (rule->iotype == NFACCT_COUNTER_IN)
return NF_IP_LOCAL_IN;
- else if(rule->iotype == NFACCT_COUNTER_OUT)
+ else if (rule->iotype == NFACCT_COUNTER_OUT)
return NF_IP_LOCAL_OUT;
return NF_IP_NUMHOOKS;
*/
static uint32_t convert_mcast_group_id(uint32_t group_id)
{
- if (group_id > 31) {
- _E("Netlink: Use setsockopt for this group: %u\n", group_id);
- return 0;
- }
- return group_id ? (1 << (group_id - 1)) : 0;
+ if (group_id > 31) {
+ _E("Netlink: Use setsockopt for this group: %u\n", group_id);
+ return 0;
+ }
+ return group_id ? (1 << (group_id - 1)) : 0;
}
static void *net_activity_func(void *user_data)
else if (ret == RESOURCED_NET_ACTIVITY_CONTINUE)
continue;
- if (context->cb(&activity_info) == RESOURCED_CANCEL)
+ if (context->cb(&activity_info) == RESOURCED_CANCEL)
goto stop_net_activity;
}
struct nlattr *start = (struct nlattr *)(
(char *)req + NLMSG_ALIGN(req->n.nlmsg_len));
- start->nla_type = NLA_F_NESTED | type;
- req->n.nlmsg_len += NLMSG_ALIGN(sizeof(struct nlattr));
- return start;
+ start->nla_type = NLA_F_NESTED | type;
+ req->n.nlmsg_len += NLMSG_ALIGN(sizeof(struct nlattr));
+ return start;
}
static void end_nest_attr(struct genl *req, struct nlattr *start)
/* tbnep+:seth_w0; means comes by bt go away by mobile interface,
* it's outgoing traffic, due all tethering is mobile databased */
iftype_part = strchr(name, ':');
- ret_value_msg_if (iftype_part == NULL,
+ ret_value_msg_if(iftype_part == NULL,
false, "Invalid format of the tethering counter %s", name);
ifname_len = iftype_part - name - 1;
strncpy(ifname_buf, name + 1, ifname_len); /* skip first t */
/* parse reply message */
na = (struct rtattr *)GENLMSG_DATA(ans);
- while (NLMSG_OK(nlhdr, ans_len )) {
+ while (NLMSG_OK(nlhdr, ans_len)) {
fill_attribute_list(attr_list, NFACCT_MAX,
na, len);
{
if (action == NFACCT_ACTION_APPEND)
return APPEND;
- else if(action == NFACCT_ACTION_DELETE)
+ else if (action == NFACCT_ACTION_DELETE)
return DELETE;
else if (action == NFACCT_ACTION_INSERT)
return INSERT;
{
if (iotype == NFACCT_COUNTER_IN)
return IN_RULE;
- else if(iotype == NFACCT_COUNTER_OUT)
+ else if (iotype == NFACCT_COUNTER_OUT)
return OUT_RULE;
return "";
if (rule->classid != RESOURCED_ALL_APP_CLASSID)
ret = produce_app_rule(rule, send_limit,
- rcv_limit, action, jump,
+ rcv_limit, action, jump,
iotype);
else
ret = produce_iface_rule(rule, send_limit, rcv_limit,
char *pa[1];
int ret;
- ret_value_msg_if (!id || !method_name, -EINVAL, "Invalid param");
+ ret_value_msg_if(!id || !method_name, -EINVAL, "Invalid param");
snprintf(buf, sizeof(buf), "%d", *id);
pa[0] = buf;
ret = call_datausage_noti(method_name, "i", pa);
- if(ret != 0) {
+ if (ret != 0) {
_E("clear noti id : %d", *id);
*id = 0;
return ret;
static int show_restriction_noti(const char *method_name)
{
- ret_value_msg_if (!method_name, -EINVAL, "Invalid param");
+ ret_value_msg_if(!method_name, -EINVAL, "Invalid param");
return call_datausage_noti(method_name, NULL, NULL);
}
void send_restriction_notification(const char *appid, data_usage_quota *du_quota)
{
if (broadcast_edbus_signal(RESOURCED_PATH_NETWORK,
- RESOURCED_INTERFACE_NETWORK,
- RESTRICTION_ACTIVE,
- DBUS_TYPE_STRING,
- (void *)(&appid)) != RESOURCED_ERROR_NONE) {
+ RESOURCED_INTERFACE_NETWORK,
+ RESTRICTION_ACTIVE,
+ DBUS_TYPE_STRING,
+ (void *)(&appid)) != RESOURCED_ERROR_NONE) {
_E("Failed to send DBUS message.");
}
void send_restriction_warn_notification(const char *appid, data_usage_quota *du_quota)
{
if (broadcast_edbus_signal(RESOURCED_PATH_NETWORK,
- RESOURCED_INTERFACE_NETWORK,
- RESTRICTION_WARNING,
- DBUS_TYPE_STRING,
- (void *)(&appid)) != RESOURCED_ERROR_NONE) {
+ RESOURCED_INTERFACE_NETWORK,
+ RESTRICTION_WARNING,
+ DBUS_TYPE_STRING,
+ (void *)(&appid)) != RESOURCED_ERROR_NONE) {
_E("Failed to send DBUS message.");
}
void send_restriction_notification(const char *appid, data_usage_quota *du_quota)
{
if (broadcast_edbus_signal(RESOURCED_PATH_NETWORK,
- RESOURCED_INTERFACE_NETWORK,
- RESTRICTION_ACTIVE,
- DBUS_TYPE_STRING,
- (void *)(&appid)) != RESOURCED_ERROR_NONE) {
+ RESOURCED_INTERFACE_NETWORK,
+ RESTRICTION_ACTIVE,
+ DBUS_TYPE_STRING,
+ (void *)(&appid)) != RESOURCED_ERROR_NONE) {
_E("Failed to send DBUS message.");
}
void send_restriction_warn_notification(const char *appid, data_usage_quota *du_quota)
{
if (broadcast_edbus_signal(RESOURCED_PATH_NETWORK,
- RESOURCED_INTERFACE_NETWORK,
- RESTRICTION_WARNING,
- DBUS_TYPE_STRING,
- (void *)(&appid)) != RESOURCED_ERROR_NONE) {
+ RESOURCED_INTERFACE_NETWORK,
+ RESTRICTION_WARNING,
+ DBUS_TYPE_STRING,
+ (void *)(&appid)) != RESOURCED_ERROR_NONE) {
_E("Failed to send DBUS message.");
}
"iftype=? and time_stamp between ? and ?"
#define RESET_FIRST_BY_NUMBER "delete from statistics where time_stamp in " \
- "(select time_stamp from statistics desc limit ?)"
+ "(select time_stamp from statistics desc limit ?)"
/* the following array is strictly ordered
* to find required statement the following code will be used:
{
resourced_ret_c result = RESOURCED_ERROR_NONE;
- ret_value_msg_if (!num, RESOURCED_ERROR_INVALID_PARAMETER,
+ ret_value_msg_if(!num, RESOURCED_ERROR_INVALID_PARAMETER,
"Invalid number of entries");
libresourced_db_initialize_once();
return RESOURCED_CONTINUE;
}
-enum restriction_apply_type
-{
+enum restriction_apply_type {
KEEP_AS_IS,
UNSET,
};
-struct apply_param
-{
+struct apply_param {
enum restriction_apply_type apply_type;
};
_D("quota rcv: % " PRId64 ", send: % " PRId64 " ", du_quota.rcv_quota, du_quota.snd_quota);
send_restriction_notification(arg->app_id, &du_quota);
- } else if(arg->quota_id && rst.rcv_warning_limit) {
+ } else if (arg->quota_id && rst.rcv_warning_limit) {
get_quota_by_id(arg->quota_id, &du_quota);
_D("quota rcv: % " PRId64 ", send: % " PRId64 " ", du_quota.rcv_quota, du_quota.snd_quota);
ret_value_if(error_code != RESOURCED_ERROR_NONE, error_code);
#ifdef DEBUG_ENABLED
- _D("app_id %s",app_id);
+ _D("app_id %s", app_id);
_D("iftype %d", iftype);
_D("imsi %s", imsi);
_D("quota_id %d", quota_id);
}
release_ifname:
- if(rst_info.ifname)
+ if (rst_info.ifname)
free((char *)rst_info.ifname);
return ret;
}
return TRUE; /*stop printing*/
}
- _SD("appid %s, rcv %u, snd %u, classid %u, iftype %d, ifname %s," \
- " is_roaming %d, ground %d",
+ _SD("appid %s, rcv %u, snd %u, classid %u, iftype %d, ifname %s," \
+ " is_roaming %d, ground %d",
appstat->application_id, appstat->rcv_count,
appstat->snd_count, (u_int32_t)composite_key->classid,
composite_key->iftype, composite_key->ifname,
VCONFKEY_TELEPHONY_SIM_SLOT_COUNT, &sim_slot_count) != 0, -1,
"failed to get sim slot count");
- if(sim_slot_count == SIM_SLOT_SINGLE) {
+ if (sim_slot_count == SIM_SLOT_SINGLE) {
_D("It's single sim model");
return current_sim;
}
dbus_error_init(&err);
- dbus_message_iter_init (msg, &iter);
- dbus_message_iter_recurse (&iter, &iter_array);
+ dbus_message_iter_init(msg, &iter);
+ dbus_message_iter_recurse(&iter, &iter_array);
current_sim = get_current_sim();
- while (dbus_message_iter_get_arg_type (&iter_array) != DBUS_TYPE_INVALID) {
+ while (dbus_message_iter_get_arg_type(&iter_array) != DBUS_TYPE_INVALID) {
const char *name;
struct modem_state *state = (struct modem_state *)malloc(
sizeof(struct modem_state));
return;
}
memset(state, 0, sizeof(struct modem_state));
- dbus_message_iter_get_basic (&iter_array, &name);
+ dbus_message_iter_get_basic(&iter_array, &name);
_D("modem name %s", name);
- dbus_message_iter_next (&iter_array);
+ dbus_message_iter_next(&iter_array);
state->name = strndup(name, strlen(name));
state->roaming = false;
modems = g_slist_prepend(modems, state);
dbus_error_init(&err);
- dbus_message_iter_init (msg, &iter);
+ dbus_message_iter_init(msg, &iter);
_D_DBUS("dbus message type %d", dbus_message_iter_get_arg_type(&iter));
- ret_msg_if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING,
+ ret_msg_if(dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING,
"Return for %s isn't variant type as expected",
DBUS_FREEDESKTOP_PROPERTIES);
- dbus_message_iter_get_basic (&iter, &plmn);
+ dbus_message_iter_get_basic(&iter, &plmn);
_D_DBUS("plmn value %d", plmn);
plmn_len = strlen(plmn);
dbus_message_iter_next(&iter);
- dbus_message_iter_get_basic (&iter, &msin);
+ dbus_message_iter_get_basic(&iter, &msin);
dbus_message_unref(msg);
dbus_error_free(&err);
_D_DBUS("msin value %d", msin);
dbus_error_init(&err);
- dbus_message_iter_init (msg, &iter);
+ dbus_message_iter_init(msg, &iter);
_D_DBUS("dbus message type %d", dbus_message_iter_get_arg_type(&iter));
- ret_msg_if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT,
+ ret_msg_if(dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT,
"Return for %s isn't variant type as expected", DBUS_FREEDESKTOP_PROPERTIES);
dbus_message_iter_recurse(&iter, &var);
_D_DBUS("dbus message variant type %d", dbus_message_iter_get_arg_type(&var));
- ret_msg_if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN,
+ ret_msg_if(dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN,
"Return for %s isn't boolean type as expected", DBUS_FREEDESKTOP_PROPERTIES);
- dbus_message_iter_get_basic (&var, &modem->roaming);
+ dbus_message_iter_get_basic(&var, &modem->roaming);
dbus_message_unref(msg);
dbus_error_free(&err);
_D("modem roaming value %d", modem->roaming);
dbus_error_init(&err);
- dbus_message_iter_init (msg, &iter);
+ dbus_message_iter_init(msg, &iter);
_D_DBUS("dbus message type %d", dbus_message_iter_get_arg_type(&iter));
- ret_msg_if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT,
+ ret_msg_if(dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT,
"Return for %s isn't variant type as expected", DBUS_FREEDESKTOP_PROPERTIES);
dbus_message_iter_recurse(&iter, &var);
_D_DBUS("dbus message variant type %d", dbus_message_iter_get_arg_type(&var));
- ret_msg_if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_INT32,
+ ret_msg_if(dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_INT32,
"Return for %s isn't int type as expected", DBUS_FREEDESKTOP_PROPERTIES);
- dbus_message_iter_get_basic (&var, &modem->protocol);
+ dbus_message_iter_get_basic(&var, &modem->protocol);
dbus_message_unref(msg);
dbus_error_free(&err);
_D("modem roaming value %d", modem->protocol);
DBusMessageIter iter, dict, prop, bool_iter;
_D_DBUS("it's signal by %s path", dbus_message_get_path(msg));
- dbus_message_iter_init (msg, &iter);
+ dbus_message_iter_init(msg, &iter);
dbus_message_iter_next(&iter);
/* call dbus_message_iter_next(&iter) */
_D_DBUS("dbus message type %d", dbus_message_iter_get_arg_type(&iter));
while (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY) {
dbus_message_iter_recurse(&iter, &dict);
_D_DBUS("dbus message variant type %d", dbus_message_iter_get_arg_type(&dict));
- ret_msg_if (dbus_message_iter_get_arg_type(&dict) != DBUS_TYPE_DICT_ENTRY,
+ ret_msg_if(dbus_message_iter_get_arg_type(&dict) != DBUS_TYPE_DICT_ENTRY,
"Return for %s isn't variant type as expected",
modem->path);
dbus_message_iter_recurse(&dict, &prop);
_D_DBUS("dbus message roaming type %d", dbus_message_iter_get_arg_type(&prop));
- ret_msg_if (dbus_message_iter_get_arg_type(&prop) != DBUS_TYPE_STRING,
+ ret_msg_if(dbus_message_iter_get_arg_type(&prop) != DBUS_TYPE_STRING,
"Return for %s isn't boolean type as expected",
modem->path);
- dbus_message_iter_get_basic (&prop, &property);
+ dbus_message_iter_get_basic(&prop, &property);
if (strncmp(property, DBUS_TELEPHONY_ROAMING_STATUS, strlen(DBUS_TELEPHONY_ROAMING_STATUS)+1) == 0) {
dbus_message_iter_next(&prop); /* it's variant here, expand it */
dbus_message_iter_recurse(&prop, &bool_iter);
- ret_msg_if (dbus_message_iter_get_arg_type(&bool_iter) != DBUS_TYPE_BOOLEAN,
+ ret_msg_if(dbus_message_iter_get_arg_type(&bool_iter) != DBUS_TYPE_BOOLEAN,
"Return for %s isn't variant type as expected", DBUS_FREEDESKTOP_PROPERTIES);
- dbus_message_iter_get_basic (&bool_iter, &modem->roaming);
+ dbus_message_iter_get_basic(&bool_iter, &modem->roaming);
_D("Roaming state for modem %s has changed", modem->name);
_D("roaming state now is %d", modem->roaming);
} else if (strncmp(property, DBUS_TELEPHONY_SERVICE_TYPE, strlen(DBUS_TELEPHONY_SERVICE_TYPE)+1) == 0) {
dbus_message_iter_next(&prop); /* it's variant here, expand it */
dbus_message_iter_recurse(&prop, &bool_iter);
- ret_msg_if (dbus_message_iter_get_arg_type(&bool_iter) != DBUS_TYPE_INT32,
+ ret_msg_if(dbus_message_iter_get_arg_type(&bool_iter) != DBUS_TYPE_INT32,
"Return for %s isn't variant type as expected", DBUS_FREEDESKTOP_PROPERTIES);
- dbus_message_iter_get_basic (&bool_iter, &modem->protocol);
+ dbus_message_iter_get_basic(&bool_iter, &modem->protocol);
_D("Protocol for modem %s has changed", modem->name);
_D("protocol now is %d", modem->protocol);
} else {
DBusMessageIter iter;
_D("it's signal by %s path", dbus_message_get_path(msg));
- dbus_message_iter_init (msg, &iter);
+ dbus_message_iter_init(msg, &iter);
arg_type = dbus_message_iter_get_arg_type(&iter);
dbus_message_iter_get_basic(&iter, &sim_status);
struct modem_state *modem = (struct modem_state *)iter->data;
if (modem->imsi == NULL)
continue;
- if(!strncmp(imsi, modem->imsi, strlen(modem->imsi)+1))
+ if (!strncmp(imsi, modem->imsi, strlen(modem->imsi)+1))
return modem->imsi_hash;
}
return NULL;
if (!user_data || !key)
return FALSE;
- return (strstr((char *)user_data, (char *)key) ? TRUE: FALSE);
+ return (strstr((char *)user_data, (char *)key) ? TRUE : FALSE);
}
static void print_favorite_list(gpointer key, gpointer value, gpointer user_data)
static int load_appusage_config(struct parse_result *result, void *user_data)
{
- if(!result)
+ if (!result)
return -EINVAL;
if (strncmp(result->section, APPUSAGE_CONF_SECTION, strlen(APPUSAGE_CONF_SECTION)+1))
int ret;
ret = config_parse(APPUSAGE_CONF_FILE, load_appusage_config, NULL);
- if(ret || !appusage_favorite_htab)
+ if (ret || !appusage_favorite_htab)
return RESOURCED_ERROR_NO_DATA;
favorite_count = g_hash_table_size(appusage_favorite_htab);
if (!pai)
return;
- pai->memory.memcg_idx= memcg_idx;
+ pai->memory.memcg_idx = memcg_idx;
pai->memory.memcg_info = memcg_info;
pai->memory.oom_score_adj = oom_score_adj;
}
struct proc_app_info *find_app_info(const pid_t pid)
{
GSList *iter = NULL;
- struct proc_app_info *pai= NULL;
+ struct proc_app_info *pai = NULL;
gslist_for_each_item(iter, proc_app_list) {
pai = (struct proc_app_info *)iter->data;
struct proc_app_info *pai, *owner;
struct proc_status ps = {0};
- if (ownerpid <= 0 || childpid <=0)
+ if (ownerpid <= 0 || childpid <= 0)
return;
ret = proc_get_oom_score_adj(ownerpid, &owner_oom);
ppi->app_list = g_slist_remove(ppi->app_list, pai);
ret = proc_get_oom_score_adj(childpid, &child_oom);
- if(ret < 0) {
+ if (ret < 0) {
_D("can't get oom score for pid (%d)", childpid);
child_oom = 0;
}
ps.pid = pid;
resourced_notify(RESOURCED_NOTIFIER_APP_WAKEUP, &ps);
} else if (len == 7) {
- if(!strncmp(str, "ex", 2)) {
+ if (!strncmp(str, "ex", 2)) {
pe.pid = pid;
pe.type = PROC_EXCLUDE;
resourced_notify(RESOURCED_NOTIFIER_CONTROL_EXCLUDE, &pe);
if (len == 6 && !strncmp(str, "wa", 2)) {
resourced_notify(RESOURCED_NOTIFIER_APP_WAKEUP, &ps);
} else if (len == 7) {
- if(!strncmp(str, "ex", 2)) {
+ if (!strncmp(str, "ex", 2)) {
pe.pid = ps.pid;
pe.type = PROC_EXCLUDE;
resourced_notify(RESOURCED_NOTIFIER_CONTROL_EXCLUDE, &pe);
if (n > 1) {
_E("Error: Too many file descriptors received: %d", n);
return -1;
- } else if (n==1) {
+ } else if (n == 1) {
fd = SD_LISTEN_FDS_START + 0;
} else {
if (access(RESOURCED_SOCKET_PATH, F_OK) == 0)
}
static void proc_set_oom_score_services(int state, GSList *svcs,
- int oom_score_adj)
+ int oom_score_adj)
{
GSList *iter;
if (spi->lru_state >= PROC_BACKGROUND) {
spi->lru_state++;
- if (spi->lru_state > PROC_LRU_MAX )
+ if (spi->lru_state > PROC_LRU_MAX)
spi->lru_state = PROC_LRU_MAX;
_D("BACKGRD : process %d increase lru %d", pid, spi->lru_state);
}
}
static int send_socket_with_repy(struct resourced_noti *msg,
- char*buf, char* len_buf)
+ char *buf, char *len_buf)
{
int client_len;
int client_sockfd;
}
static resourced_ret_c proc_send_get_status(const int type, char* pid_buf,
- char*buf, char* len_buf)
+ char *buf, char *len_buf)
{
struct resourced_noti *msg;
resourced_ret_c ret = RESOURCED_ERROR_NONE;
}
API resourced_ret_c proc_stat_get_pid_entry(int type, pid_t pid,
- char* buf, int len)
+ char *buf, int len)
{
char pid_buf[MAX_DEC_SIZE(int)];
char len_buf[MAX_DEC_SIZE(int)];
if (rst_type == RST_SET)
carg->opts->state |= RESOURCED_NET_BLOCKED_STATE; /* set bit */
else {
- carg->opts->state &=(~RESOURCED_NET_BLOCKED_STATE); /* nulify bit */
+ carg->opts->state &= (~RESOURCED_NET_BLOCKED_STATE); /* nulify bit */
ecore_timer_thaw(carg->ecore_timer);
}
}
/* Get internal memory status */
memset(&s, 0x00, sizeof(struct storage_size));
- if (storage_get_size(INTERNAL, &s) < 0 ) {
+ if (storage_get_size(INTERNAL, &s) < 0) {
_E("Fail to get internal memory size");
} else {
int_tot = s.total_size;
/* Get external memory status */
memset(&s, 0x00, sizeof(struct storage_size));
- if (storage_get_size(EXTERNAL, &s) < 0 ) {
+ if (storage_get_size(EXTERNAL, &s) < 0) {
_E("Fail to get external memory size");
} else {
ext_tot = s.total_size;
fputs("Sluggishness type: MULTIMEDIA\n", fptr);
/* 4. Write sluggish PID and process name */
- fprintf(fptr,"Sluggish PID:%d\n", pid);
+ fprintf(fptr, "Sluggish PID:%d\n", pid);
/* Get process name */
snprintf(proc, sizeof(proc), "/proc/%d/cmdline", pid);
}
/* 5. Write CPU usage */
- fprintf(fptr,"CPU used:%3.2lf%%, idle:%3.2lf%%\n", cpu_usage, (100 - cpu_usage));
+ fprintf(fptr, "CPU used:%3.2lf%%, idle:%3.2lf%%\n", cpu_usage, (100 - cpu_usage));
fclose(fptr);
}
enum swap_state swap_get_state(void)
{
- struct shared_modules_data *modules_data = get_shared_modules_data();
+ struct shared_modules_data *modules_data = get_shared_modules_data();
- ret_value_msg_if(modules_data == NULL, RESOURCED_ERROR_FAIL,
- "Invalid shared modules data\n");
+ ret_value_msg_if(modules_data == NULL, RESOURCED_ERROR_FAIL,
+ "Invalid shared modules data\n");
- return modules_data->swap_data.swap_state;
+ return modules_data->swap_data.swap_state;
}
struct child_pid *child;
child = (struct child_pid *)(iter_child->data);
- ret= place_pid_to_cgroup_by_fullpath(mi->name, child->pid);
+ ret = place_pid_to_cgroup_by_fullpath(mi->name, child->pid);
}
pai->memory.memcg_idx = MEMCG_SWAP;
pai->memory.memcg_info = mi;
}
static int swap_sort_by_oom(const struct swap_task *ta,
- const struct swap_task *tb)
+ const struct swap_task *tb)
{
/* sort by oom score adj */
assert(ta != NULL);
}
static int swap_sort_by_vmrss(const struct swap_task *ta,
- const struct swap_task *tb)
+ const struct swap_task *tb)
{
/* sort by task memory usage */
assert(ta != NULL);
#include <sys/types.h>
#include <dirent.h>
-#define TIMER_EXCLUDE_CGROUP "exclude"
-#define TIMER_SERVICE_CGROUP "service"
-#define TIMER_BACKGRD_CGROUP "background"
-#define TIMER_STATUS_LCDOFF "LCDOFF"
+#define TIMER_EXCLUDE_CGROUP "exclude"
+#define TIMER_SERVICE_CGROUP "service"
+#define TIMER_BACKGRD_CGROUP "background"
+#define TIMER_STATUS_LCDOFF "LCDOFF"
#define TIMER_SLACK_ROOT NULL
-#define TIMER_STATUS_POWERSAVING "POWERSAVING"
+#define TIMER_STATUS_POWERSAVING "POWERSAVING"
#define TIMER_CONF_FILE RD_CONFIG_FILE(timer-slack)
-#define EXCLUDE_CONF_SECTION "EXCLUDE_TIMER_SLACK"
-#define EXCLUDE_CONF_NAME "EXCLUDE_PROC_NAME"
+#define EXCLUDE_CONF_SECTION "EXCLUDE_TIMER_SLACK"
+#define EXCLUDE_CONF_NAME "EXCLUDE_PROC_NAME"
#define TIMER_SLACK_MODE "/timer_slack.timer_mode"
#define TIMER_SLACK_VALUE "/timer_slack.min_slack_ns"
timer_slack[i].slack_value = atoi(result->value);
}
}
- return RESOURCED_ERROR_NONE;
+ return RESOURCED_ERROR_NONE;
}
static void timer_slack_cgroup_init(void)
#include "module-data.h"
#include "vip-process.h"
-#define VIP_CONF_FILE RD_CONFIG_FILE(vip-process)
+#define VIP_CONF_FILE RD_CONFIG_FILE(vip-process)
static char **arg_vip_proc_names = NULL;
static char **arg_vip_systemd_services = NULL;
if (wpid == 0) {
if (times < MAX_TIMES) {
sleep(WAIT_TIMEOUT);
- times ++;
+ times++;
} else {
_D("timeout!!, kill child process(%s)\n",
argv[0]);