提交 791d0952 编写于 作者: E Eric Blake

build: use correct limit for unsigned long long

Reported by Jason Helfman as a build-breaker on FreeBSD.

* src/conf/domain_conf.c (virDomainFSDefParseXML): Use POSIX
spelling.
* src/openvz/openvz_conf.c (openvzReadFSConf): Likewise.
上级 b1675bac
......@@ -4248,14 +4248,12 @@ virDomainFSDefParseXML(xmlNodePtr node,
if (virDomainParseScaledValue("./space_hard_limit[1]", ctxt,
&def->space_hard_limit, 1,
ULONG_LONG_MAX,
false) < 0)
ULLONG_MAX, false) < 0)
goto error;
if (virDomainParseScaledValue("./space_soft_limit[1]", ctxt,
&def->space_soft_limit, 1,
ULONG_LONG_MAX,
false) < 0)
ULLONG_MAX, false) < 0)
goto error;
cur = node->children;
......@@ -4335,7 +4333,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
}
if (unit &&
virScaleInteger(&def->usage, unit,
1024, ULONG_LONG_MAX) < 0)
1024, ULLONG_MAX) < 0)
goto error;
}
......
......@@ -455,8 +455,8 @@ openvzReadFSConf(virDomainDefPtr def,
goto error;
} else {
/* Ensure that we can multiply by 1024 without overflowing. */
if (barrier > ULONG_LONG_MAX / 1024 ||
limit > ULONG_LONG_MAX / 1024 ) {
if (barrier > ULLONG_MAX / 1024 ||
limit > ULLONG_MAX / 1024 ) {
virReportSystemError(VIR_ERR_OVERFLOW,
_("%s"),
"Unable to parse quota");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册