Merged revisions 570-575,577-578 via svnmerge from
[senf.git] / Socket / Protocols / DVB / DVBFrontendHandle.cc
index eda5a1b..43dcd1c 100644 (file)
@@ -3,7 +3,7 @@
 // Copyright (C) 2007
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+//     Thorsten Horstmann <thorsten.horstmann@fokus.fraunhofer.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
-#include "Utils/Exception.hh"
+#include "../../../Utils/Exception.hh"
 
 //#include "DVBFrontendHandle.mpp"
 #define prefix_
@@ -45,10 +45,10 @@ prefix_ void senf::DVBFrontendProtocol::init_client(uint8_t adapter, boost::uint
 {
     std::string devFrontend = str( boost::format(
             "/dev/dvb/adapter%d/frontend%d") % adapter % device);
-    int fd = open(devFrontend.c_str(), O_RDONLY | O_NONBLOCK);
-    if (fd < 0)
-        throw SystemException(errno);
-    body().fd(fd);
+    int f = open(devFrontend.c_str(), O_RDONLY | O_NONBLOCK);
+    if (f < 0)
+        throwErrno();
+    fd(f);
 }
 
 prefix_ unsigned senf::DVBFrontendProtocol::available()
@@ -73,8 +73,8 @@ prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBFrontendProtocol::clone()
 prefix_ void senf::DVBFrontendProtocol::signalStrength(int16_t *strength)
     const
 {
-    if (::ioctl(body().fd(), FE_READ_SIGNAL_STRENGTH, strength) < 0)
-        throw SystemException(errno);
+    if (::ioctl(fd(), FE_READ_SIGNAL_STRENGTH, strength) < 0)
+        throwErrno();
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////