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 (#2173).
  • Loading branch information
lrtfm authored Jul 28, 2022
1 parent d4017a2 commit 93403e1
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 93403e1

Please sign in to comment.