diff options
| author | Kenta Iwasaki <63115601+lithdew@users.noreply.github.com> | 2020-09-04 02:57:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-03 13:57:08 -0400 |
| commit | 50e39069518a0c2643cd5e3189ad087b5fbed0c6 (patch) | |
| tree | a8998ecbe97dfe5a5616191440ae5758dd613a66 /lib/std/os.zig | |
| parent | 969547902b49d6b21af762fb24ed591789b9d2a4 (diff) | |
| download | zig-50e39069518a0c2643cd5e3189ad087b5fbed0c6.tar.gz zig-50e39069518a0c2643cd5e3189ad087b5fbed0c6.zip | |
os: return error.SocketNotListening for EINVAL on accept (#6226)
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index e8431c386b..2e4cc3aed0 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2802,6 +2802,9 @@ pub const AcceptError = error{ /// by the socket buffer limits, not by the system memory. SystemResources, + /// Socket is not listening for new connections. + SocketNotListening, + ProtocolFailure, /// Firewall rules forbid connection. @@ -2870,7 +2873,7 @@ pub fn accept( EBADF => unreachable, // always a race condition ECONNABORTED => return error.ConnectionAborted, EFAULT => unreachable, - EINVAL => unreachable, + EINVAL => return error.SocketNotListening, ENOTSOCK => unreachable, EMFILE => return error.ProcessFdQuotaExceeded, ENFILE => return error.SystemFdQuotaExceeded, |
