summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>2012-12-29 20:33:29 +0100
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>2012-12-29 20:33:29 +0100
commitcb33be9e2ee7bad9b1afd082659b66fb83bdd489 (patch)
tree8c8cb15e77865b71022f39b4a0adb1a71819bfc4
parent164386ca42aea42d4643a0209c1a14799bfcfb6c (diff)
downloadvdr-plugin-inputdev-cb33be9e2ee7bad9b1afd082659b66fb83bdd489.tar.gz
vdr-plugin-inputdev-cb33be9e2ee7bad9b1afd082659b66fb83bdd489.tar.bz2
conditionalized systemd support
-rw-r--r--inputdev.cc4
-rw-r--r--plugin.cc12
2 files changed, 15 insertions, 1 deletions
diff --git a/inputdev.cc b/inputdev.cc
index e31fb8a..5774bd6 100644
--- a/inputdev.cc
+++ b/inputdev.cc
@@ -665,6 +665,8 @@ err:
return false;
}
+#ifdef VDR_USE_SYSTEMD
+
#include <systemd/sd-daemon.h>
bool cInputDeviceController::open_udev_socket(unsigned int systemd_idx)
{
@@ -685,6 +687,8 @@ bool cInputDeviceController::open_udev_socket(unsigned int systemd_idx)
return is_valid;
}
+#endif
+
void cInputDeviceController::cleanup_devices(void)
{
dev_mutex_.Lock();
diff --git a/plugin.cc b/plugin.cc
index 8e769b0..2f07f63 100644
--- a/plugin.cc
+++ b/plugin.cc
@@ -84,7 +84,15 @@ bool cInputDevicePlugin::ProcessArgs(int argc, char *argv[])
break;
switch (c) {
- case 'S': systemd_idx = optarg; break;
+ case 'S':
+#ifdef VDR_USE_SYSTEMD
+ systemd_idx = optarg;
+ break;
+#else
+ esyslog("%s: systemd support has not been compiled in\n",
+ Name());
+ return false;
+#endif
case 's': socket_path = optarg; break;
default:
esyslog("%s: invalid option\n", Name());
@@ -120,9 +128,11 @@ bool cInputDevicePlugin::Initialize(void)
controller_ = new cInputDeviceController(*this);
switch (socket_type_) {
+#ifdef VDR_USE_SYSTEMD
case enSYSTEMD:
is_ok = controller_->open_udev_socket(socket_.idx);
break;
+#endif
case enSOCKET:
is_ok = controller_->open_udev_socket(socket_.path);