Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more errno definitions for better backwards compat with 0.21.0 #1467

Merged
merged 1 commit into from Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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