]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys/unix/thread.rs
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / library / std / src / sys / unix / thread.rs
index d847f2775ab7611bfcc249c32763179683f0cb04..b251949bda207e1bf0fcfa99750e7311f4412dce 100644 (file)
@@ -505,7 +505,7 @@ fn quota_v2(group_path: PathBuf) -> usize {
                     let limit = raw_quota.next()?;
                     let period = raw_quota.next()?;
                     match (limit.parse::<usize>(), period.parse::<usize>()) {
-                        (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),
                     _ => {}
                 }