if (strstr(app_id, STC_BACKGROUND_APP_SUFFIX))
path_to_net_cgroup_dir = BACKGROUND_CGROUP_NETWORK;
+ else if (strstr(app_id, STC_TETHERING_APP_SUFFIX))
+ path_to_net_cgroup_dir = TETHERING_CGROUP_NETWORK;
else
path_to_net_cgroup_dir = FOREGROUND_CGROUP_NETWORK;
stc_error_e place_pids_to_net_cgroup(const int pid, const char *app_id)
{
- char child_buf[21 + MAX_DEC_SIZE(int) + MAX_DEC_SIZE(int)];
+ char child_buf[21 + MAX_DEC_SIZE(int) + MAX_DEC_SIZE(int) + 1];
const char *path_to_net_cgroup_dir = NULL;
snprintf(child_buf, sizeof(child_buf), PROC_TASK_CHILDREN, pid, pid);
path_to_net_cgroup_dir = STC_CGROUP_NETWORK;
else if (strstr(app_id, STC_BACKGROUND_APP_SUFFIX))
path_to_net_cgroup_dir = BACKGROUND_CGROUP_NETWORK;
+ else if (strstr(app_id, STC_TETHERING_APP_SUFFIX))
+ path_to_net_cgroup_dir = TETHERING_CGROUP_NETWORK;
else
path_to_net_cgroup_dir = FOREGROUND_CGROUP_NETWORK; //LCOV_EXCL_LINE
- if (access(child_buf, F_OK)) {
- if (STC_DEBUG_LOG)
- STC_LOGD("%s of %s is not existed", child_buf, app_id); //LCOV_EXCL_LINE
+ if (access(child_buf, F_OK))
return cgroup_write_pid(path_to_net_cgroup_dir, app_id, pid);
- }
return cgroup_write_pidtree(path_to_net_cgroup_dir, app_id, pid); //LCOV_EXCL_LINE
}