diff options
-rw-r--r-- | src/nxt_errno.h | 1 | ||||
-rw-r--r-- | src/nxt_http_static.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/nxt_errno.h b/src/nxt_errno.h index e3ce8349..1b29ef2f 100644 --- a/src/nxt_errno.h +++ b/src/nxt_errno.h @@ -16,6 +16,7 @@ typedef int nxt_err_t; #define NXT_ENOPATH ENOENT #define NXT_ESRCH ESRCH #define NXT_EINTR EINTR +#define NXT_ENXIO ENXIO #define NXT_ECHILD ECHILD #define NXT_ENOMEM ENOMEM #define NXT_EACCES EACCES diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c index 4679af5b..48a989cf 100644 --- a/src/nxt_http_static.c +++ b/src/nxt_http_static.c @@ -94,9 +94,20 @@ nxt_http_static_handler(nxt_task_t *task, nxt_http_request_t *r, if (nxt_slow_path(ret != NXT_OK)) { switch (f->error) { + /* + * For Unix domain sockets "errno" is set to: + * - ENXIO on Linux; + * - EOPNOTSUPP on *BSD, MacOSX, and Solaris. + */ + case NXT_ENOENT: case NXT_ENOTDIR: case NXT_ENAMETOOLONG: +#if (NXT_LINUX) + case NXT_ENXIO: +#else + case NXT_EOPNOTSUPP: +#endif level = NXT_LOG_ERR; status = NXT_HTTP_NOT_FOUND; break; |