Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: net/udp/udp_socket_libevent.cc

Issue 1025533002: PCHECK when closing UDP sockets only when errno=EBADF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_libevent.cc
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc
index 6fdb94e5eb15e69de304145860163de27489388e..ceb1ad3e0b9c7964d977fcdfebff2920725b5bb3 100644
--- a/net/udp/udp_socket_libevent.cc
+++ b/net/udp/udp_socket_libevent.cc
@@ -126,7 +126,8 @@ void UDPSocketLibevent::Close() {
ok = write_socket_watcher_.StopWatchingFileDescriptor();
DCHECK(ok);
- PCHECK(0 == IGNORE_EINTR(close(socket_)));
+ if (IGNORE_EINTR(close(socket_)) == -1)
+ PCHECK(errno != EBADF);
rvargas (doing something else) 2015/03/19 22:34:05 How about filtering by EIO instead and leaving err
Sergey Ulanov 2015/03/19 22:53:35 Done.
socket_ = kInvalidSocket;
addr_family_ = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698