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).

(cherry picked from commit d502d19)
  • Loading branch information
lrtfm authored and Johannes Lerch committed Jun 2, 2023
1 parent e30485b commit 0dd96e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion src/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

using namespace std;

const char* kNinjaVersion = "1.11.0.conti.2";
const char* kNinjaVersion = "1.11.1.conti.1";

void ParseVersion(const string& version, int* major, int* minor) {
size_t end = version.find('.');
Expand Down

0 comments on commit 0dd96e9

Please sign in to comment.