Index: webrtc/base/physicalsocketserver.cc |
diff --git a/webrtc/base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc |
index 3b395ce63cf3f308838ce65818547cc295e6b512..2c4d0f9e11d5e937cb4e60adc12e6a8b1eafe189 100644 |
--- a/webrtc/base/physicalsocketserver.cc |
+++ b/webrtc/base/physicalsocketserver.cc |
@@ -138,7 +138,8 @@ PhysicalSocket::PhysicalSocket(PhysicalSocketServer* ss, SOCKET s) |
int type = SOCK_STREAM; |
socklen_t len = sizeof(type); |
- VERIFY(0 == getsockopt(s_, SOL_SOCKET, SO_TYPE, (SockOptArg)&type, &len)); |
+ int res = getsockopt(s_, SOL_SOCKET, SO_TYPE, (SockOptArg)&type, &len); |
+ RTC_DCHECK (res == 0); |
kwiberg-webrtc
2017/02/07 09:39:49
Spurious space. Also, RTC_DCHECK_EQ?
|
udp_ = (SOCK_DGRAM == type); |
} |
} |
@@ -834,7 +835,9 @@ class EventDispatcher : public Dispatcher { |
CritScope cs(&crit_); |
if (!fSignaled_) { |
const uint8_t b[1] = {0}; |
- if (VERIFY(1 == write(afd_[1], b, sizeof(b)))) { |
+ ssize_t res = write(afd_[1], b, sizeof(b)); |
+ RTC_DCHECK(1 == res); |
+ if (res == 1) { |
fSignaled_ = true; |
} |
kwiberg-webrtc
2017/02/07 09:39:49
Hmm. You're not supposed to handle DCHECK failures
nisse-webrtc
2017/02/07 10:48:15
I'm deleting the if. And changing to const and DCH
|
} |
@@ -849,7 +852,8 @@ class EventDispatcher : public Dispatcher { |
CritScope cs(&crit_); |
if (fSignaled_) { |
uint8_t b[4]; // Allow for reading more than 1 byte, but expect 1. |
- VERIFY(1 == read(afd_[0], b, sizeof(b))); |
+ ssize_t res = read(afd_[0], b, sizeof(b)); |
kwiberg-webrtc
2017/02/07 09:39:49
const? (You don't *have* to, but I recommend const
nisse-webrtc
2017/02/07 10:48:15
Done.
|
+ RTC_DCHECK(1 == res); |
kwiberg-webrtc
2017/02/07 09:39:49
RTC_DCHECK_EQ, especially if you want the argument
nisse-webrtc
2017/02/07 10:48:15
Done.
|
fSignaled_ = false; |
} |
} |