Skip to content

Commit

Permalink
Add more errno definitions for better backwards compat with 0.21.0
Browse files Browse the repository at this point in the history
Fixes #1466
  • Loading branch information
asomers committed Jul 15, 2021
1 parent eac4b65 commit 459b385
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
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
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 459b385

Please sign in to comment.