diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-13 23:52:47 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-13 23:52:47 +0000 |
commit | e1b0a04002b316835b3d2ee4b10eaef1425d450a (patch) | |
tree | 6edbead93f1bdab4dcf3038fe17c7e423d4a5108 /net/udp/udp_socket_win.cc | |
parent | c7220f3ce2cd4a1b83f2a43adb3016c7d76aebc8 (diff) | |
download | chromium_src-e1b0a04002b316835b3d2ee4b10eaef1425d450a.zip chromium_src-e1b0a04002b316835b3d2ee4b10eaef1425d450a.tar.gz chromium_src-e1b0a04002b316835b3d2ee4b10eaef1425d450a.tar.bz2 |
Get proper value for OS error to histogram
BUG=326545
Review URL: https://codereview.chromium.org/115363003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/udp/udp_socket_win.cc')
-rw-r--r-- | net/udp/udp_socket_win.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc index 7b7a528..45403f5 100644 --- a/net/udp/udp_socket_win.cc +++ b/net/udp/udp_socket_win.cc @@ -665,9 +665,11 @@ int UDPSocketWin::DoBind(const IPEndPoint& address) { if (!address.ToSockAddr(storage.addr, &storage.addr_len)) return ERR_ADDRESS_INVALID; int rv = bind(socket_, storage.addr, storage.addr_len); - if (rv < 0) - UMA_HISTOGRAM_SPARSE_SLOWLY("Net.UdpSocketBindErrorFromWinOS", rv); - return rv < 0 ? MapSystemError(WSAGetLastError()) : rv; + if (rv == 0) + return OK; + int last_error = WSAGetLastError(); + UMA_HISTOGRAM_SPARSE_SLOWLY("Net.UdpSocketBindErrorFromWinOS", last_error); + return MapSystemError(last_error); } int UDPSocketWin::RandomBind(const IPAddressNumber& address) { |