]> git.tdb.fi Git - libs/net.git/blobdiff - source/streamlistensocket.cpp
Use SystemError at appropriate places
[libs/net.git] / source / streamlistensocket.cpp
index df80b001f30e1eef9941d4ca70af353145c657b7..2a8bc3d216e89c85a4a69e1dd17017601c7e4ee7 100644 (file)
@@ -5,7 +5,7 @@ Copyright © 2008  Mikkosoft Productions, Mikko Rasa
 Distributed under the LGPL
 */
 
-#include <errno.h>
+#include <cerrno>
 #include <msp/core/refptr.h>
 #include <msp/strings/formatter.h>
 #include "streamlistensocket.h"
@@ -30,7 +30,7 @@ void StreamListenSocket::listen(const SockAddr &addr, unsigned backlog)
 
        int err=::listen(handle, backlog);
        if(err==-1)
-               throw Exception(format("Unable to listen: %s", strerror(errno)));
+               throw SystemError("Unable to listen", errno);
 
 #ifdef WIN32
        WSAEventSelect(handle, event, FD_ACCEPT);