Skip to content

Commit b07fc51

Browse files
committed
Set nolimit (infinity) as the error mode since this is Rust-specific
1 parent 88c0581 commit b07fc51

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/sys/resource.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ pub fn getrlimit(resource: Resource) -> Result<(Option<rlim_t>, Option<rlim_t>)>
134134
/// [`Resource`]: enum.Resource.html
135135
pub fn setrlimit(resource: Resource, soft_limit: Option<rlim_t>, hard_limit: Option<rlim_t>) -> Result<()> {
136136
let mut rlim: rlimit = unsafe { mem::uninitialized() };
137-
// TODO: How do we handle the case where soft_limit isn't Some()?
138137
rlim.rlim_cur = soft_limit.unwrap_or(RLIM_INFINITY);
139138
rlim.rlim_max = hard_limit.unwrap_or(RLIM_INFINITY);
140-
139+
141140
let res = unsafe { libc::setrlimit(resource as c_int, &rlim as *const _) };
142141
Errno::result(res).map(|_| ())
143142
}

0 commit comments

Comments
 (0)