From 4f72f2145b902fcfefee8fa90419c9bf28d74bc2 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 6 Mar 2014 20:26:11 +0400 Subject: [PATCH] error: add ENXIO for O_NONBLOCK FIFO open() When opening FIFO with `O_NONBLOCK` flag, `ENXIO` could be returned if the readable side hasn't yet opened this FIFO. --- include/uv.h | 1 + src/unix/error.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uv.h b/include/uv.h index c0945f13..dbd045df 100644 --- a/include/uv.h +++ b/include/uv.h @@ -134,6 +134,7 @@ extern "C" { XX( 61, ENOPROTOOPT, "protocol not available") \ XX( 62, ETXTBSY, "text file is busy") \ XX( 63, ERANGE, "result too large") \ + XX( 64, ENXIO, "no such device or address") \ #define UV_ERRNO_GEN(val, name, s) UV_##name = val, diff --git a/src/unix/error.c b/src/unix/error.c index 91efc72f..dead2c2e 100644 --- a/src/unix/error.c +++ b/src/unix/error.c @@ -108,6 +108,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) { case ENOPROTOOPT: return UV_ENOPROTOOPT; case ETXTBSY: return UV_ETXTBSY; case ERANGE: return UV_ERANGE; + case ENXIO: return UV_ENXIO; default: return UV_UNKNOWN; } UNREACHABLE();