X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Fsys%2Funix%2Fthread.rs;h=b251949bda207e1bf0fcfa99750e7311f4412dce;hb=b22c152958eade17a71d899b29a2d39bcc77aa48;hp=d847f2775ab7611bfcc249c32763179683f0cb04;hpb=8dfb3395411555e93399671d0c41a4ac9ed62b95;p=rust.git diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/unix/thread.rs index d847f2775ab..b251949bda2 100644 --- a/library/std/src/sys/unix/thread.rs +++ b/library/std/src/sys/unix/thread.rs @@ -505,7 +505,7 @@ fn quota_v2(group_path: PathBuf) -> usize { let limit = raw_quota.next()?; let period = raw_quota.next()?; match (limit.parse::(), period.parse::()) { - (Ok(limit), Ok(period)) => { + (Ok(limit), Ok(period)) if period > 0 => { quota = quota.min(limit / period); } _ => {} @@ -565,7 +565,7 @@ fn quota_v1(group_path: PathBuf) -> usize { let period = parse_file("cpu.cfs_period_us"); match (limit, period) { - (Some(limit), Some(period)) => quota = quota.min(limit / period), + (Some(limit), Some(period)) if period > 0 => quota = quota.min(limit / period), _ => {} }