Permalink
Browse files

Add uv__new_sys_error

  • Loading branch information...
1 parent 6d688d3 commit 721bc72d5dca64f385621efc1bb0c25bfc86e8f4 @piscisaureus piscisaureus committed Oct 28, 2011
Showing with 9 additions and 0 deletions.
  1. +8 −0 src/uv-common.c
  2. +1 −0 src/uv-common.h
View
@@ -115,6 +115,14 @@ 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 error;
+ error.code = uv_translate_sys_error(sys_error);
+ error.sys_errno_ = sys_error;
+ return error;
+}
+
+
uv_err_t uv_last_error(uv_loop_t* loop) {
return loop->last_err;
}
View
@@ -52,6 +52,7 @@ uv_err_code uv_translate_sys_error(int sys_errno);
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);
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 721bc72

Please sign in to comment.