Skip to content

Commit

Permalink
Merge #989
Browse files Browse the repository at this point in the history
989: DragonflyBSD: Remove unused Errno's r=asomers a=levex

EUNUSED* were removed from <sys/errno.h> in DragonflyBSD, so there is no
need for them to be in nix either. This also fixes the build on
DragonflyBSD.

r? @asomers 
cc/ @mneumann 
Signed-off-by: Levente Kurusa <lkurusa@acm.org>

Co-authored-by: Levente Kurusa <lkurusa@acm.org>
  • Loading branch information
bors[bot] and levex committed Dec 6, 2018
2 parents f278094 + 9d2dc7c commit 307cc90
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/errno.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(not(target_os = "dragonfly"))]
use libc;
use libc::c_int;
use libc::{c_int, c_void};
use std::{fmt, io, error};
use {Error, Result};

Expand Down Expand Up @@ -103,8 +103,8 @@ impl ErrnoSentinel for i64 {
fn sentinel() -> Self { -1 }
}

impl ErrnoSentinel for *mut libc::c_void {
fn sentinel() -> Self { (-1 as isize) as *mut libc::c_void }
impl ErrnoSentinel for *mut c_void {
fn sentinel() -> Self { (-1 as isize) as *mut c_void }
}

impl error::Error for Errno {
Expand Down Expand Up @@ -521,9 +521,6 @@ fn desc(errno: Errno) -> &'static str {
#[cfg(target_os = "openbsd")]
EIPSEC => "IPsec processing failure",

#[cfg(target_os = "dragonfly")]
EUNUSED94 | EUNUSED95 | EUNUSED96 | EUNUSED97 | EUNUSED98 => "Unused",

#[cfg(target_os = "dragonfly")]
EASYNC => "Async",
}
Expand Down Expand Up @@ -1373,11 +1370,6 @@ mod consts {
ENOLINK = libc::ENOLINK,
EPROTO = libc::EPROTO,
ENOMEDIUM = libc::ENOMEDIUM,
EUNUSED94 = libc::EUNUSED94,
EUNUSED95 = libc::EUNUSED95,
EUNUSED96 = libc::EUNUSED96,
EUNUSED97 = libc::EUNUSED97,
EUNUSED98 = libc::EUNUSED98,
EASYNC = libc::EASYNC,
}

Expand Down Expand Up @@ -1485,11 +1477,6 @@ mod consts {
libc::ENOLINK => ENOLINK,
libc::EPROTO => EPROTO,
libc::ENOMEDIUM => ENOMEDIUM,
libc::EUNUSED94 => EUNUSED94,
libc::EUNUSED95 => EUNUSED95,
libc::EUNUSED96 => EUNUSED96,
libc::EUNUSED97 => EUNUSED97,
libc::EUNUSED98 => EUNUSED98,
libc::EASYNC => EASYNC,
_ => UnknownErrno,
}
Expand Down

0 comments on commit 307cc90

Please sign in to comment.