summaryrefslogtreecommitdiff
path: root/deps/uv/src/uv-common.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-02-20 21:12:18 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-02-20 21:29:52 +0100
commit6ad792610b9e3a0c96206fc1f6968b0eb69956c1 (patch)
tree8f9728e8c5cee05ef5ebfae95966fb5310384a2e /deps/uv/src/uv-common.c
parentd69a26b9650df7dc1f210c3c59df74ec4245dff3 (diff)
downloadandroid-node-v8-6ad792610b9e3a0c96206fc1f6968b0eb69956c1.tar.gz
android-node-v8-6ad792610b9e3a0c96206fc1f6968b0eb69956c1.tar.bz2
android-node-v8-6ad792610b9e3a0c96206fc1f6968b0eb69956c1.zip
deps: upgrade libuv to 26fa6f8
Diffstat (limited to 'deps/uv/src/uv-common.c')
-rw-r--r--deps/uv/src/uv-common.c70
1 files changed, 30 insertions, 40 deletions
diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c
index 0b05334945..ae2ca71474 100644
--- a/deps/uv/src/uv-common.c
+++ b/deps/uv/src/uv-common.c
@@ -197,44 +197,38 @@ int uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size) {
int uv_tcp_bind(uv_tcp_t* handle, struct sockaddr_in addr) {
- if (handle->type != UV_TCP || addr.sin_family != AF_INET) {
- uv__set_artificial_error(handle->loop, UV_EINVAL);
- return -1;
- }
-
- return uv__tcp_bind(handle, addr);
+ if (handle->type != UV_TCP || addr.sin_family != AF_INET)
+ return uv__set_artificial_error(handle->loop, UV_EINVAL);
+ else
+ return uv__tcp_bind(handle, addr);
}
int uv_tcp_bind6(uv_tcp_t* handle, struct sockaddr_in6 addr) {
- if (handle->type != UV_TCP || addr.sin6_family != AF_INET6) {
- uv__set_artificial_error(handle->loop, UV_EINVAL);
- return -1;
- }
-
- return uv__tcp_bind6(handle, addr);
+ if (handle->type != UV_TCP || addr.sin6_family != AF_INET6)
+ return uv__set_artificial_error(handle->loop, UV_EINVAL);
+ else
+ return uv__tcp_bind6(handle, addr);
}
-int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr,
- unsigned int flags) {
- if (handle->type != UV_UDP || addr.sin_family != AF_INET) {
- uv__set_artificial_error(handle->loop, UV_EINVAL);
- return -1;
- }
-
- return uv__udp_bind(handle, addr, flags);
+int uv_udp_bind(uv_udp_t* handle,
+ struct sockaddr_in addr,
+ unsigned int flags) {
+ if (handle->type != UV_UDP || addr.sin_family != AF_INET)
+ return uv__set_artificial_error(handle->loop, UV_EINVAL);
+ else
+ return uv__udp_bind(handle, addr, flags);
}
-int uv_udp_bind6(uv_udp_t* handle, struct sockaddr_in6 addr,
- unsigned int flags) {
- if (handle->type != UV_UDP || addr.sin6_family != AF_INET6) {
- uv__set_artificial_error(handle->loop, UV_EINVAL);
- return -1;
- }
-
- return uv__udp_bind6(handle, addr, flags);
+int uv_udp_bind6(uv_udp_t* handle,
+ struct sockaddr_in6 addr,
+ unsigned int flags) {
+ if (handle->type != UV_UDP || addr.sin6_family != AF_INET6)
+ return uv__set_artificial_error(handle->loop, UV_EINVAL);
+ else
+ return uv__udp_bind6(handle, addr, flags);
}
@@ -242,12 +236,10 @@ int uv_tcp_connect(uv_connect_t* req,
uv_tcp_t* handle,
struct sockaddr_in address,
uv_connect_cb cb) {
- if (handle->type != UV_TCP || address.sin_family != AF_INET) {
- uv__set_artificial_error(handle->loop, UV_EINVAL);
- return -1;
- }
-
- return uv__tcp_connect(req, handle, address, cb);
+ if (handle->type != UV_TCP || address.sin_family != AF_INET)
+ return uv__set_artificial_error(handle->loop, UV_EINVAL);
+ else
+ return uv__tcp_connect(req, handle, address, cb);
}
@@ -255,12 +247,10 @@ int uv_tcp_connect6(uv_connect_t* req,
uv_tcp_t* handle,
struct sockaddr_in6 address,
uv_connect_cb cb) {
- if (handle->type != UV_TCP || address.sin6_family != AF_INET6) {
- uv__set_artificial_error(handle->loop, UV_EINVAL);
- return -1;
- }
-
- return uv__tcp_connect6(req, handle, address, cb);
+ if (handle->type != UV_TCP || address.sin6_family != AF_INET6)
+ return uv__set_artificial_error(handle->loop, UV_EINVAL);
+ else
+ return uv__tcp_connect6(req, handle, address, cb);
}