aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/SocketMonitor.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-07 23:56:49 +0200
committerMax Kellermann <max@duempel.org>2013-08-08 00:18:59 +0200
commit0287ac794e5117772953394fcbc93912cf8e3c22 (patch)
tree6ca3a1b398c2d9958ab06e46ffa3fd4ca43a5d88 /src/event/SocketMonitor.cxx
parent0005221533aa4c4859e818f2599545392efe916d (diff)
downloadmpd-0287ac794e5117772953394fcbc93912cf8e3c22.tar.gz
mpd-0287ac794e5117772953394fcbc93912cf8e3c22.tar.xz
mpd-0287ac794e5117772953394fcbc93912cf8e3c22.zip
event/SocketMonitor: add assertions
Diffstat (limited to 'src/event/SocketMonitor.cxx')
-rw-r--r--src/event/SocketMonitor.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/event/SocketMonitor.cxx b/src/event/SocketMonitor.cxx
index 92aac9a92..9bb6e47cf 100644
--- a/src/event/SocketMonitor.cxx
+++ b/src/event/SocketMonitor.cxx
@@ -138,6 +138,8 @@ SocketMonitor::Close()
SocketMonitor::ssize_t
SocketMonitor::Read(void *data, size_t length)
{
+ assert(IsDefined());
+
int flags = 0;
#ifdef MSG_DONTWAIT
flags |= MSG_DONTWAIT;
@@ -149,6 +151,8 @@ SocketMonitor::Read(void *data, size_t length)
SocketMonitor::ssize_t
SocketMonitor::Write(const void *data, size_t length)
{
+ assert(IsDefined());
+
int flags = 0;
#ifdef MSG_NOSIGNAL
flags |= MSG_NOSIGNAL;
@@ -163,5 +167,7 @@ SocketMonitor::Write(const void *data, size_t length)
void
SocketMonitor::CommitEventFlags()
{
+ assert(IsDefined());
+
loop.WakeUp();
}