Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add uv__new_artificial_error()

  • Loading branch information...
ry committed Nov 8, 2011
1 parent f1859eb commit b7da0a69bf721343782f9e8d7ea189f9999feaa2
Showing with 10 additions and 2 deletions.
  1. +9 −2 src/uv-common.c
  2. +1 −0 src/uv-common.h
@@ -121,8 +121,7 @@ void uv__set_sys_error(uv_loop_t* loop, int sys_error) {


void uv__set_artificial_error(uv_loop_t* loop, uv_err_code code) {
loop->last_err.code = code;
loop->last_err.sys_errno_ = 0;
loop->last_err = uv__new_artificial_error(code);
}


@@ -134,6 +133,14 @@ uv_err_t uv__new_sys_error(int sys_error) {
}


uv_err_t uv__new_artificial_error(uv_err_code code) {
uv_err_t error;
error.code = code;
error.sys_errno_ = 0;
return error;
}


uv_err_t uv_last_error(uv_loop_t* loop) {
return loop->last_err;
}
@@ -55,6 +55,7 @@ void uv__set_error(uv_loop_t* loop, uv_err_code code, int sys_error);
void uv__set_sys_error(uv_loop_t* loop, int sys_error);
void uv__set_artificial_error(uv_loop_t* loop, uv_err_code code);
uv_err_t uv__new_sys_error(int sys_error);
uv_err_t uv__new_artificial_error(uv_err_code code);

int uv__tcp_bind(uv_tcp_t* handle, struct sockaddr_in addr);
int uv__tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6 addr);

0 comments on commit b7da0a6

Please sign in to comment.
You can’t perform that action at this time.