Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
unix, windows: return UV_EINVAL, not UV_EFAULT
A wrong multicast membership should return EINVAL.
  • Loading branch information
txdv authored and bnoordhuis committed Jan 22, 2013
1 parent 017e2d5 commit bdb498f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/unix/udp.c
Expand Up @@ -542,8 +542,7 @@ int uv_udp_set_membership(uv_udp_t* handle, const char* multicast_addr,
optname = IP_DROP_MEMBERSHIP;
break;
default:
uv__set_sys_error(handle->loop, EFAULT);
return -1;
return uv__set_artificial_error(handle->loop, UV_EINVAL);
}

if (setsockopt(handle->io_watcher.fd, IPPROTO_IP, optname, (void*) &mreq, sizeof mreq) == -1) {
Expand Down
3 changes: 1 addition & 2 deletions src/win/udp.c
Expand Up @@ -615,8 +615,7 @@ int uv_udp_set_membership(uv_udp_t* handle, const char* multicast_addr,
optname = IP_DROP_MEMBERSHIP;
break;
default:
uv__set_artificial_error(handle->loop, UV_EFAULT);
return -1;
return uv__set_artificial_error(handle->loop, UV_EINVAL);
}

if (setsockopt(handle->socket,
Expand Down

0 comments on commit bdb498f

Please sign in to comment.