From: Robert Swiecki Date: Wed, 25 Oct 2017 13:44:35 +0000 (+0200) Subject: Use uint64_t instead of __rlim64_t X-Git-Tag: 2.2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1260e49f33f6a3c0a4fb9869e003838f89fa648;p=platform%2Fupstream%2Fnsjail.git Use uint64_t instead of __rlim64_t --- diff --git a/cgroup.c b/cgroup.c index b74b2cf..99fa007 100644 --- a/cgroup.c +++ b/cgroup.c @@ -141,11 +141,12 @@ static bool cgroupInitNsFromParentNetCls(struct nsjconf_t* nsjconf, pid_t pid) char fname[PATH_MAX]; if (nsjconf->cgroup_net_cls_classid != (unsigned int)0) { char net_cls_classid_str[512]; - snprintf(net_cls_classid_str, sizeof(net_cls_classid_str), "0x%x", nsjconf->cgroup_net_cls_classid); + snprintf(net_cls_classid_str, sizeof(net_cls_classid_str), "0x%x", + nsjconf->cgroup_net_cls_classid); snprintf(fname, sizeof(fname), "%s/net_cls.classid", net_cls_cgroup_path); LOG_D("Setting '%s' to '%s'", fname, net_cls_classid_str); - if (!utilWriteBufToFile( - fname, net_cls_classid_str, strlen(net_cls_classid_str), O_WRONLY | O_CLOEXEC)) { + if (!utilWriteBufToFile(fname, net_cls_classid_str, strlen(net_cls_classid_str), + O_WRONLY | O_CLOEXEC)) { LOG_E("Could not update net_cls cgroup classid"); return false; } diff --git a/cmdline.c b/cmdline.c index 513236d..7681ecc 100644 --- a/cmdline.c +++ b/cmdline.c @@ -261,7 +261,7 @@ void cmdlineLogParams(struct nsjconf_t* nsjconf) } } -__rlim64_t cmdlineParseRLimit(int res, const char* optarg, unsigned long mul) +uint64_t cmdlineParseRLimit(int res, const char* optarg, unsigned long mul) { if (strcasecmp(optarg, "inf") == 0) { return RLIM64_INFINITY; @@ -281,7 +281,7 @@ __rlim64_t cmdlineParseRLimit(int res, const char* optarg, unsigned long mul) "provided)", res, optarg); } - __rlim64_t val = strtoull(optarg, NULL, 0) * mul; + uint64_t val = strtoull(optarg, NULL, 0) * mul; if (val == ULLONG_MAX && errno != 0) { PLOG_F("strtoul('%s', 0)", optarg); } diff --git a/cmdline.h b/cmdline.h index d107d1f..61dae54 100644 --- a/cmdline.h +++ b/cmdline.h @@ -29,7 +29,7 @@ #include "nsjail.h" -__rlim64_t cmdlineParseRLimit(int res, const char* optarg, unsigned long mul); +uint64_t cmdlineParseRLimit(int res, const char* optarg, unsigned long mul); void cmdlineLogParams(struct nsjconf_t* nsjconf); bool cmdlineParse(int argc, char* argv[], struct nsjconf_t* nsjconf); diff --git a/nsjail.h b/nsjail.h index 107cbb8..d9a8ad9 100644 --- a/nsjail.h +++ b/nsjail.h @@ -123,13 +123,13 @@ struct nsjconf_t { bool keep_env; bool keep_caps; bool disable_no_new_privs; - __rlim64_t rl_as; - __rlim64_t rl_core; - __rlim64_t rl_cpu; - __rlim64_t rl_fsize; - __rlim64_t rl_nofile; - __rlim64_t rl_nproc; - __rlim64_t rl_stack; + uint64_t rl_as; + uint64_t rl_core; + uint64_t rl_cpu; + uint64_t rl_fsize; + uint64_t rl_nofile; + uint64_t rl_nproc; + uint64_t rl_stack; unsigned long personality; bool clone_newnet; bool clone_newuser;