Skip to content

Commit a5e0b72

Browse files
committed
Simplify definition of SIGNALFD_SIGINFO_SIZE
mem::size_of has been a const fn since Rust 1.24.0. Use it.
1 parent 5ed5bb6 commit a5e0b72

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/sys/signalfd.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ libc_bitflags!{
3434
}
3535

3636
pub const SIGNALFD_NEW: RawFd = -1;
37-
pub const SIGNALFD_SIGINFO_SIZE: usize = 128;
37+
pub const SIGNALFD_SIGINFO_SIZE: usize = mem::size_of::<libc::signalfd_siginfo>();
3838

3939
/// Creates a new file descriptor for reading signals.
4040
///
@@ -144,14 +144,6 @@ impl Iterator for SignalFd {
144144
#[cfg(test)]
145145
mod tests {
146146
use super::*;
147-
use std::mem;
148-
use libc;
149-
150-
151-
#[test]
152-
fn check_siginfo_size() {
153-
assert_eq!(mem::size_of::<libc::signalfd_siginfo>(), SIGNALFD_SIGINFO_SIZE);
154-
}
155147

156148
#[test]
157149
fn create_signalfd() {

0 commit comments

Comments
 (0)