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:
parent
3166484387
commit
991672a030
1 changed files with 5 additions and 5 deletions
|
@ -3,13 +3,13 @@
|
||||||
// * For the full copyright and license information, please view the LICENSE
|
// * For the full copyright and license information, please view the LICENSE
|
||||||
// * file that was distributed with this source code.
|
// * 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)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use rlimit::{prlimit, rlim};
|
use rlimit::prlimit;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
@ -893,7 +893,7 @@ pub struct UCommand {
|
||||||
stderr: Option<Stdio>,
|
stderr: Option<Stdio>,
|
||||||
bytes_into_stdin: Option<Vec<u8>>,
|
bytes_into_stdin: Option<Vec<u8>>,
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
limits: Vec<(rlimit::Resource, rlim, rlim)>,
|
limits: Vec<(rlimit::Resource, u64, u64)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UCommand {
|
impl UCommand {
|
||||||
|
@ -1046,8 +1046,8 @@ impl UCommand {
|
||||||
pub fn with_limit(
|
pub fn with_limit(
|
||||||
&mut self,
|
&mut self,
|
||||||
resource: rlimit::Resource,
|
resource: rlimit::Resource,
|
||||||
soft_limit: rlim,
|
soft_limit: u64,
|
||||||
hard_limit: rlim,
|
hard_limit: u64,
|
||||||
) -> &mut Self {
|
) -> &mut Self {
|
||||||
self.limits.push((resource, soft_limit, hard_limit));
|
self.limits.push((resource, soft_limit, hard_limit));
|
||||||
self
|
self
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue