Skip to content

Commit

Permalink
Fixbug: SIGFPE error when cpu.cfs_period_us = 0
Browse files Browse the repository at this point in the history
This will fix the issue (ninja-build#2173).
  • Loading branch information
lrtfm authored and bradking committed Oct 6, 2022
1 parent bb471e2 commit cac1772
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cac1772

Please sign in to comment.