summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-08-10 18:06:46 -0600
committerAlan Somers <asomers@gmail.com>2021-08-17 20:06:26 -0600
commita5e0b723a22b788b3b3d955cfe3f0155b0f92b02 (patch)
treea98aa111014c9cfd700d1da090aa76202a4cfe42 /src
parent5ed5bb634fbef82c5dcd6e64e9b609dff08e378d (diff)
downloadnix-a5e0b723a22b788b3b3d955cfe3f0155b0f92b02.zip
Simplify definition of SIGNALFD_SIGINFO_SIZE
mem::size_of has been a const fn since Rust 1.24.0. Use it.
Diffstat (limited to 'src')
-rw-r--r--src/sys/signalfd.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/sys/signalfd.rs b/src/sys/signalfd.rs
index 49811a1a..9d5de036 100644
--- a/src/sys/signalfd.rs
+++ b/src/sys/signalfd.rs
@@ -34,7 +34,7 @@ libc_bitflags!{
}
pub const SIGNALFD_NEW: RawFd = -1;
-pub const SIGNALFD_SIGINFO_SIZE: usize = 128;
+pub const SIGNALFD_SIGINFO_SIZE: usize = mem::size_of::<libc::signalfd_siginfo>();
/// Creates a new file descriptor for reading signals.
///
@@ -144,14 +144,6 @@ impl Iterator for SignalFd {
#[cfg(test)]
mod tests {
use super::*;
- use std::mem;
- use libc;
-
-
- #[test]
- fn check_siginfo_size() {
- assert_eq!(mem::size_of::<libc::signalfd_siginfo>(), SIGNALFD_SIGINFO_SIZE);
- }
#[test]
fn create_signalfd() {