// $Id$
//
// Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Thorsten Horstmann <tho@berlios.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
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <fcntl.h>
-#include "Utils/Exception.hh"
+#include "../../../Utils/Exception.hh"
//#include "DVBDemuxHandles.mpp"
#define prefix_
{
std::string devDemux = str( boost::format(
"/dev/dvb/adapter%d/demux%d") % adapter % device);
- int fd = open(devDemux.c_str(), O_RDONLY | O_NONBLOCK);
- if (fd < 0)
- throw SystemException(errno);
- body().fd(fd);
+ int f = open(devDemux.c_str(), O_RDONLY | O_NONBLOCK);
+ if (f < 0)
+ throwErrno();
+ fd(f);
}
prefix_ unsigned senf::DVBDemuxSectionProtocol::available()
prefix_ void senf::DVBDemuxSectionProtocol::setSectionFilter(struct dmx_sct_filter_params *filter)
const
{
- if (::ioctl(body().fd(), DMX_SET_FILTER, filter) < 0)
- throw SystemException(errno);
+ if (::ioctl(fd(), DMX_SET_FILTER, filter) < 0)
+ throwErrno();
}
// ----------------------------------------------------------------
{
std::string devDemux = str( boost::format(
"/dev/dvb/adapter%d/demux%d") % adapter % device);
- int fd = open(devDemux.c_str(), O_RDONLY | O_NONBLOCK);
- if (fd < 0)
- throw SystemException(errno);
- body().fd(fd);
+ int f = open(devDemux.c_str(), O_RDONLY | O_NONBLOCK);
+ if (f < 0)
+ throwErrno();
+ fd(f);
}
prefix_ unsigned senf::DVBDemuxPESProtocol::available()
prefix_ void senf::DVBDemuxPESProtocol::setPESFilter(struct dmx_pes_filter_params *filter)
const
{
- if (::ioctl(body().fd(), DMX_SET_PES_FILTER, filter) < 0)
- throw SystemException(errno);
+ if (::ioctl(fd(), DMX_SET_PES_FILTER, filter) < 0)
+ throwErrno();
}
// ----------------------------------------------------------------
{
std::string devDvr = str( boost::format(
"/dev/dvb/adapter%d/dvr%d") % adapter % device);
- int fd = open(devDvr.c_str(), O_RDONLY | O_NONBLOCK);
- if (fd < 0)
- throw SystemException(errno);
- body().fd(fd);
+ int f = open(devDvr.c_str(), O_RDONLY | O_NONBLOCK);
+ if (f < 0)
+ throwErrno();
+ fd(f);
}
prefix_ unsigned senf::DVBDvrProtocol::available()