aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugin_dvb.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/plugin_dvb.c b/plugin_dvb.c
index 95715ad..783519a 100644
--- a/plugin_dvb.c
+++ b/plugin_dvb.c
@@ -64,6 +64,8 @@ static HASH DVB;
static int get_dvb_stats(void)
{
+ static int ioc_disable = 0;
+
int age;
int fd;
unsigned short snr, sig;
@@ -82,24 +84,40 @@ static int get_dvb_stats(void)
return -1;
}
- if (ioctl(fd, FE_READ_SIGNAL_STRENGTH, &sig) != 0) {
+ sig = 0;
+ if ((ioc_disable & 0x01) == 0 && ioctl(fd, FE_READ_SIGNAL_STRENGTH, &sig) != 0) {
error("ioctl(FE_READ_SIGNAL_STRENGTH) failed: %s", strerror(errno));
- sig = 0;
+ if (errno == ENOSYS) {
+ ioc_disable |= 0x01;
+ error("ioctl(FE_READ_SIGNAL_STRENGTH) disabled.");
+ }
}
- if (ioctl(fd, FE_READ_SNR, &snr) != 0) {
+ snr = 0;
+ if ((ioc_disable & 0x02) == 0 && ioctl(fd, FE_READ_SNR, &snr) != 0) {
error("ioctl(FE_READ_SNR) failed: %s", strerror(errno));
- snr = 0;
+ if (errno == ENOSYS) {
+ ioc_disable |= 0x02;
+ error("ioctl(FE_READ_SNR) disabled.");
+ }
}
- if (ioctl(fd, FE_READ_BER, &ber) != 0) {
+ ber = 0;
+ if ((ioc_disable & 0x04) == 0 && ioctl(fd, FE_READ_BER, &ber) != 0) {
error("ioctl(FE_READ_BER) failed: %s", strerror(errno));
- ber = 0;
+ if (errno == ENOSYS) {
+ ioc_disable |= 0x04;
+ error("ioctl(FE_READ_BER) disabled.");
+ }
}
- if (ioctl(fd, FE_READ_UNCORRECTED_BLOCKS, &ucb) != 0) {
+ ucb = 0;
+ if ((ioc_disable & 0x08) == 0 && ioctl(fd, FE_READ_UNCORRECTED_BLOCKS, &ucb) != 0) {
error("ioctl(FE_READ_UNCORRECTED_BLOCKS) failed: %s", strerror(errno));
- ucb = 0;
+ if (errno == ENOSYS) {
+ ioc_disable |= 0x08;
+ error("ioctl(FE_READ_UNCORRECTED_BLOCKS) disabled.");
+ }
}
close(fd);
itle='2014-07-23 01:09:56 +0100'>2014-07-23Release 0+git20140611.14bd6c7-1debian/0+git20140611.14bd6c7-1Jonathan McCrohan1-2/+2 2014-07-23New Upstream Snapshot (commit 14bd6c7)Jonathan McCrohan1-2/+3 2014-07-23Imported Upstream version 0+git20140611.14bd6c7upstream/0+git20140611.14bd6c7Jonathan McCrohan7-11/+60 2014-05-13New Upstream Snapshot (commit 1246b27)Jonathan McCrohan1-0/+6 2014-05-13Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9