1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

Adjust rlimit usage with the new version

This commit is contained in:
Sylvestre Ledru 2022-04-12 09:18:29 +02:00
parent 3166484387
commit 991672a030

View file

@ -3,13 +3,13 @@
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
//spell-checker: ignore (linux) rlimit prlimit Rlim coreutil ggroups
//spell-checker: ignore (linux) rlimit prlimit coreutil ggroups
#![allow(dead_code)]
use pretty_assertions::assert_eq;
#[cfg(target_os = "linux")]
use rlimit::{prlimit, rlim};
use rlimit::prlimit;
#[cfg(unix)]
use std::borrow::Cow;
use std::env;
@ -893,7 +893,7 @@ pub struct UCommand {
stderr: Option<Stdio>,
bytes_into_stdin: Option<Vec<u8>>,
#[cfg(target_os = "linux")]
limits: Vec<(rlimit::Resource, rlim, rlim)>,
limits: Vec<(rlimit::Resource, u64, u64)>,
}
impl UCommand {
@ -1046,8 +1046,8 @@ impl UCommand {
pub fn with_limit(
&mut self,
resource: rlimit::Resource,
soft_limit: rlim,
hard_limit: rlim,
soft_limit: u64,
hard_limit: u64,
) -> &mut Self {
self.limits.push((resource, soft_limit, hard_limit));
self