Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Add EEXIST handling
Browse files Browse the repository at this point in the history
Additionally, map ERROR_ALREADY_EXISTS to EEXIST on Windows.  I'm a bit
unsure about this mapping.  Could a windows person confirm?
  • Loading branch information
isaacs committed Sep 12, 2011
1 parent e7eeacb commit 3c00d87
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/uv.h
Expand Up @@ -183,7 +183,8 @@ typedef enum {
UV_EAINONAME,
UV_EAISERVICE,
UV_EAISOCKTYPE,
UV_ESHUTDOWN
UV_ESHUTDOWN,
UV_EEXIST
} uv_err_code;

typedef enum {
Expand Down
1 change: 1 addition & 0 deletions src/unix/error.c
Expand Up @@ -83,6 +83,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case EADDRINUSE: return UV_EADDRINUSE;
case EADDRNOTAVAIL: return UV_EADDRNOTAVAIL;
case ENOTCONN: return UV_ENOTCONN;
case EEXIST: return UV_EEXIST;
default: return UV_UNKNOWN;
}

Expand Down
1 change: 1 addition & 0 deletions src/uv-common.c
Expand Up @@ -87,6 +87,7 @@ const char* uv_err_name(uv_err_t err) {
case UV_EPROTONOSUPPORT: return "EPROTONOSUPPORT";
case UV_EPROTOTYPE: return "EPROTOTYPE";
case UV_ETIMEDOUT: return "ETIMEDOUT";
case UV_EEXIST: return "EEXIST";
default:
assert(0);
return NULL;
Expand Down
1 change: 1 addition & 0 deletions src/win/error.c
Expand Up @@ -130,6 +130,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_BROKEN_PIPE: return UV_EOF;
case ERROR_PIPE_BUSY: return UV_EBUSY;
case ERROR_SEM_TIMEOUT: return UV_ETIMEDOUT;
case ERROR_ALREADY_EXISTS: return UV_EEXIST;
default: return UV_UNKNOWN;
}
}
Expand Down

0 comments on commit 3c00d87

Please sign in to comment.