Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: use rlim_t when working with limits
Leah Neukirchen committed 1 year ago
commit 41c33901ff6a70e87e649ba61c5d52c84f661ed1
parent c8062bc4a7cfd55d73dba08f03986ccb2f4e27ee
1 file changed +2 -5
modified radicle/src/io.rs
@@ -1,12 +1,9 @@
use std::fmt;
use std::io;

-
use libc::{getrlimit, rlimit, setrlimit, RLIMIT_NOFILE};
+
use libc::{getrlimit, rlim_t, rlimit, setrlimit, RLIMIT_NOFILE};

-
#[cfg(not(target_os = "freebsd"))]
-
type Int = u64;
-
#[cfg(target_os = "freebsd")]
-
type Int = i64;
+
type Int = rlim_t;

/// Sets the open file limit to the given value, or the maximum allowed value.
pub fn set_file_limit<N>(n: N) -> io::Result<Int>