summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Zongze <yangzongze@gmail.com>2022-07-28 14:35:24 +0800
committerJan Niklas Hasse <jhasse@bixense.com>2022-08-30 21:45:05 +0200
commitd502d19378a40a77a8d66f55c35d8c50c99a2423 (patch)
treed87669f2790659ceb20e9ab9c7189971399b3131
parent51edeeb063a82693573db43782d9e3733b2840e4 (diff)
downloadninja-d502d19378a40a77a8d66f55c35d8c50c99a2423.tar.gz
Fixbug: SIGFPE error when cpu.cfs_period_us = 0
This will fix the issue (#2173).
-rw-r--r--src/util.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc
index 483f4a6..ef5f103 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -647,6 +647,8 @@ int ParseCPUFromCGroup() {
readCount(cpu->second + "/cpu.cfs_period_us");
if (!period.second)
return -1;
+ if (period.first == 0)
+ return -1;
return quota.first / period.first;
}
#endif