From: g0dil Date: Sat, 24 Nov 2007 17:04:52 +0000 (+0000) Subject: Socket/Protocols/Raw: Use throwErrno() in TunTapSocketHandle X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=05aff4588889ff615efebd1dd0d3fff494399f80;p=senf.git Socket/Protocols/Raw: Use throwErrno() in TunTapSocketHandle git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@534 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/Protocols/Raw/TunTapSocketHandle.cc b/Socket/Protocols/Raw/TunTapSocketHandle.cc index cd46920..c2ab043 100644 --- a/Socket/Protocols/Raw/TunTapSocketHandle.cc +++ b/Socket/Protocols/Raw/TunTapSocketHandle.cc @@ -50,7 +50,7 @@ prefix_ void senf::TapProtocol::init_client(std::string const & interface_name, { int fd; if ( (fd = ::open("/dev/net/tun", O_RDWR)) < 0 ) - throw SystemException(errno); + throwErrno(); struct ifreq ifr; ::memset( &ifr, 0, sizeof(ifr)); ifr.ifr_flags = IFF_TAP; @@ -58,7 +58,7 @@ prefix_ void senf::TapProtocol::init_client(std::string const & interface_name, ifr.ifr_flags |= IFF_NO_PI; interface_name.copy( ifr.ifr_name, IFNAMSIZ); if (::ioctl(fd, TUNSETIFF, (void *) &ifr) < 0 ) - throw SystemException(errno); + throwErrno(); body().fd(fd); } @@ -75,7 +75,7 @@ prefix_ unsigned senf::TapProtocol::available() return 0; ssize_t l = ::recv(body().fd(),0,0,MSG_PEEK | MSG_TRUNC); if (l < 0) - throw SystemException(errno); + throwErrno(); return l; }