summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-08-05 00:16:04 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-08-05 00:16:04 +0100
commit84f1fc14930eaa05f55c557138545d6ff832e270 (patch)
treed44d43c848c6d81242e78dcdb18c206bae1e1e3d
parentMove the frontend file descriptor ownership into the parent tuner as an AdHoc... (diff)
downloadp2pvr-84f1fc14930eaa05f55c557138545d6ff832e270.tar.bz2
p2pvr-84f1fc14930eaa05f55c557138545d6ff832e270.tar.xz
p2pvr-84f1fc14930eaa05f55c557138545d6ff832e270.zip
Drop out local file hanlde for AdHoc's
-rw-r--r--p2pvr/devices/tuner.cpp3
-rw-r--r--p2pvr/lib/fileHandle.cpp29
-rw-r--r--p2pvr/lib/fileHandle.h23
3 files changed, 1 insertions, 54 deletions
diff --git a/p2pvr/devices/tuner.cpp b/p2pvr/devices/tuner.cpp
index b13e5c1..73dcd67 100644
--- a/p2pvr/devices/tuner.cpp
+++ b/p2pvr/devices/tuner.cpp
@@ -7,7 +7,6 @@
#include <linux/dvb/frontend.h>
#include <linux/dvb/dmx.h>
#include <boost/tuple/tuple.hpp>
-#include "fileHandle.h"
#include <cxxabi.h>
#include "tunerSendSi.h"
#include "tunerSendTs.h"
@@ -143,7 +142,7 @@ Tuner::SendPID(int pid, const RawDataClientPrx & client, const Ice::Current & ic
if (ice.con) {
ice.con->createProxy(client->ice_getIdentity());
}
- FileHandle demux(OpenDemux());
+ AdHoc::FileUtils::FileHandle demux(OpenDemux());
RequestPID(pid, demux);
return ReadDemuxAndSend(demux, client);
}
diff --git a/p2pvr/lib/fileHandle.cpp b/p2pvr/lib/fileHandle.cpp
deleted file mode 100644
index e568f44..0000000
--- a/p2pvr/lib/fileHandle.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "fileHandle.h"
-#include <unistd.h>
-#include <stdexcept>
-
-namespace P2PVR {
-class InvalidFileHandle : public std::runtime_error {
- public:
- InvalidFileHandle() : std::runtime_error("Invalid file handle") { }
-};
-
-FileHandle::FileHandle(int f) :
- fd(f)
-{
- if (fd < 0) {
- throw InvalidFileHandle();
- }
-}
-
-FileHandle::~FileHandle()
-{
- close(fd);
-}
-
-FileHandle::operator int() const
-{
- return fd;
-}
-}
-
diff --git a/p2pvr/lib/fileHandle.h b/p2pvr/lib/fileHandle.h
deleted file mode 100644
index f2d6929..0000000
--- a/p2pvr/lib/fileHandle.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef FILEHANDLE_H
-#define FILEHANDLE_H
-
-#include <visibility.h>
-
-namespace P2PVR {
-class DLL_PUBLIC FileHandle {
- public:
- FileHandle(int fd);
- ~FileHandle();
-
- FileHandle(const FileHandle &) = delete;
- void operator=(const FileHandle &) = delete;
-
- operator int() const;
-
- private:
- const int fd;
-};
-}
-
-#endif
-