Skip to content

Commit

Permalink
Merge #1467
Browse files Browse the repository at this point in the history
1467: Add more errno definitions for better backwards compat with 0.21.0 r=asomers a=asomers

Fixes #1464

Co-authored-by: Alan Somers <[email protected]>
  • Loading branch information
bors[bot] and asomers authored Jul 15, 2021
2 parents eac4b65 + 459b385 commit 1a78595
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ This project adheres to [Semantic Versioning](https://semver.org/).
(#[1464](https://github.com/nix-rust/nix/pull/1464))

### Fixed

- Added more errno definitions for better backwards compatibility with
Nix 0.21.0.
(#[1467](https://github.com/nix-rust/nix/pull/1467))

### Removed

## [0.22.0] - 9 July 2021
Expand Down
113 changes: 113 additions & 0 deletions src/errno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,22 @@ mod consts {
EHWPOISON = libc::EHWPOISON,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EDEADLOCK instead"
)]
pub const EDEADLOCK: Errno = Errno::EDEADLK;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ENOTSUP instead"
)]
pub const ENOTSUP: Errno = Errno::EOPNOTSUPP;

impl Errno {
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
pub const EDEADLOCK: Errno = Errno::EDEADLK;
Expand Down Expand Up @@ -1167,6 +1183,22 @@ mod consts {
EQFULL = libc::EQFULL,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ELAST instead"
)]
pub const ELAST: Errno = Errno::EQFULL;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EDEADLOCK instead"
)]
pub const EDEADLOCK: Errno = Errno::EDEADLK;

impl Errno {
pub const ELAST: Errno = Errno::EQFULL;
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
Expand Down Expand Up @@ -1392,6 +1424,27 @@ mod consts {
EOWNERDEAD = libc::EOWNERDEAD,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ELAST instead"
)]
pub const ELAST: Errno = Errno::EOWNERDEAD;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EDEADLOCK instead"
)]
pub const EDEADLOCK: Errno = Errno::EDEADLK;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EOPNOTSUPP instead"
)]
pub const EOPNOTSUPP: Errno = Errno::ENOTSUP;

impl Errno {
pub const ELAST: Errno = Errno::EOWNERDEAD;
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
Expand Down Expand Up @@ -1607,6 +1660,27 @@ mod consts {
EASYNC = libc::EASYNC,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ELAST instead"
)]
pub const ELAST: Errno = Errno::EASYNC;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EDEADLOCK instead"
)]
pub const EDEADLOCK: Errno = Errno::EDEADLK;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EOPNOTSUPP instead"
)]
pub const EOPNOTSUPP: Errno = Errno::ENOTSUP;

impl Errno {
pub const ELAST: Errno = Errno::EASYNC;
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
Expand Down Expand Up @@ -1821,6 +1895,17 @@ mod consts {
EPROTO = libc::EPROTO,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ELAST instead"
)]
pub const ELAST: Errno = Errno::ENOTSUP;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;

impl Errno {
pub const ELAST: Errno = Errno::ENOTSUP;
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
Expand Down Expand Up @@ -2034,6 +2119,17 @@ mod consts {
EPROTO = libc::EPROTO,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ELAST instead"
)]
pub const ELAST: Errno = Errno::ENOTSUP;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;

impl Errno {
pub const ELAST: Errno = Errno::ENOTSUP;
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
Expand Down Expand Up @@ -2237,6 +2333,12 @@ mod consts {
EPROTO = libc::EPROTO,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;

impl Errno {
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
}
Expand Down Expand Up @@ -2464,6 +2566,17 @@ mod consts {
ESTALE = libc::ESTALE,
}

#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::ELAST instead"
)]
pub const ELAST: Errno = Errno::ELAST;
#[deprecated(
since = "0.22.1",
note = "use nix::errno::Errno::EWOULDBLOCK instead"
)]
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;

impl Errno {
pub const ELAST: Errno = Errno::ESTALE;
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
Expand Down

0 comments on commit 1a78595

Please sign in to comment.