Utils: Implement more flexible SystemException
[senf.git] / Socket / Protocols / INet / TCPProtocol.cc
index 6c7337d..79646be 100644 (file)
@@ -45,7 +45,7 @@ prefix_ bool senf::TCPProtocol::nodelay()
     int value;
     socklen_t len (sizeof(value));
     if (::getsockopt(body().fd(),SOL_TCP,TCP_NODELAY,&value,&len) < 0)
-        throw SystemException(errno);
+        throwErrno();
     return value;
 }
 
@@ -54,7 +54,7 @@ prefix_ void senf::TCPProtocol::nodelay(bool value)
 {
     int ivalue (value);
     if (::setsockopt(body().fd(),SOL_TCP,TCP_NODELAY,&ivalue,sizeof(ivalue)) < 0)
-        throw SystemException(errno);
+        throwErrno();
 }
 
 prefix_ unsigned senf::TCPProtocol::siocinq()
@@ -62,7 +62,7 @@ prefix_ unsigned senf::TCPProtocol::siocinq()
 {
     int n;
     if (::ioctl(body().fd(),SIOCINQ,&n) < 0)
-        throw SystemException(errno);
+        throwErrno();
     return n;
 }
 
@@ -71,7 +71,7 @@ prefix_ unsigned senf::TCPProtocol::siocoutq()
 {
     int n;
     if (::ioctl(body().fd(),SIOCOUTQ,&n) < 0)
-        throw SystemException(errno);
+        throwErrno();
     return n;
 }