static bool cgroupInitNsFromParentPids(struct nsjconf_t* nsjconf, pid_t pid)
{
- if (nsjconf->cgroup_pids_max == (size_t)0) {
+ if (nsjconf->cgroup_pids_max == 0U) {
return true;
}
}
char fname[PATH_MAX];
- if (nsjconf->cgroup_pids_max != (size_t)0) {
+ if (nsjconf->cgroup_pids_max != 0U) {
char pids_max_str[512];
- snprintf(pids_max_str, sizeof(pids_max_str), "%zu", nsjconf->cgroup_pids_max);
+ snprintf(pids_max_str, sizeof(pids_max_str), "%u", nsjconf->cgroup_pids_max);
snprintf(fname, sizeof(fname), "%s/pids.max", pids_cgroup_path);
LOG_D("Setting '%s' to '%s'", fname, pids_max_str);
if (!utilWriteBufToFile(
static bool cgroupInitNsFromParentNetCls(struct nsjconf_t* nsjconf, pid_t pid)
{
- if (nsjconf->cgroup_net_cls_classid == (unsigned int)0) {
+ if (nsjconf->cgroup_net_cls_classid == 0U) {
return true;
}
}
char fname[PATH_MAX];
- if (nsjconf->cgroup_net_cls_classid != (unsigned int)0) {
+ if (nsjconf->cgroup_net_cls_classid != 0U) {
char net_cls_classid_str[512];
snprintf(net_cls_classid_str, sizeof(net_cls_classid_str), "0x%x",
nsjconf->cgroup_net_cls_classid);
void cgroupFinishFromParentPids(struct nsjconf_t* nsjconf, pid_t pid)
{
- if (nsjconf->cgroup_pids_max == (size_t)0) {
+ if (nsjconf->cgroup_pids_max == 0) {
return;
}
char pids_cgroup_path[PATH_MAX];
.cgroup_mem_max = (size_t)0,
.cgroup_pids_mount = "/sys/fs/cgroup/pids",
.cgroup_pids_parent = "NSJAIL",
- .cgroup_pids_max = (size_t)0,
+ .cgroup_pids_max = (unsigned int)0,
.cgroup_net_cls_mount = "/sys/fs/cgroup/net_cls",
.cgroup_net_cls_parent = "NSJAIL",
.cgroup_net_cls_classid = (unsigned int)0,
nsjconf->cgroup_mem_parent = optarg;
break;
case 0x811:
- nsjconf->cgroup_pids_max = (size_t)strtoull(optarg, NULL, 0);
+ nsjconf->cgroup_pids_max = (unsigned int)strtoul(optarg, NULL, 0);
break;
case 0x812:
nsjconf->cgroup_pids_mount = optarg;
size_t cgroup_mem_max;
const char* cgroup_pids_mount;
const char* cgroup_pids_parent;
- size_t cgroup_pids_max;
+ unsigned int cgroup_pids_max;
const char* cgroup_net_cls_mount;
const char* cgroup_net_cls_parent;
unsigned int cgroup_net_cls_classid;