From 70a9709562d376b2f71bb910af11e9375effec8c Mon Sep 17 00:00:00 2001 From: Lars Hanisch Date: Thu, 27 Oct 2011 00:31:51 +0200 Subject: correct call of the idle hook --- HISTORY | 4 ++++ dynamicdevice.c | 8 +++++--- dynamite.c | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index 6e0d287..1a6c73b 100644 --- a/HISTORY +++ b/HISTORY @@ -196,3 +196,7 @@ VDR Plugin 'dynamite' Revision History 2011-10-26: Version 0.0.8b - add udev monitor for remove events of usb hardware so devices can be detached on unplugging + +2011-10-27: Version 0.0.8c + +- correct call of the idle hook diff --git a/dynamicdevice.c b/dynamicdevice.c index 267038a..dc44ed0 100644 --- a/dynamicdevice.c +++ b/dynamicdevice.c @@ -295,9 +295,11 @@ eDynamicDeviceReturnCode cDynamicDevice::SetLockDevice(const char *DevPath, bool static void CallIdleHook(const char *IdleHook, const char *DevPath, bool Idle) { - const char *idleHookCmd = *cString::sprintf("%s --idle=%s --device=%s", IdleHook, (Idle ? "on" : "off"), DevPath); - isyslog("dynamite: calling idle hook %s", idleHookCmd); - SystemExec(idleHookCmd, false); + cString idleHookCmd = cString::sprintf("%s --idle=%s --device=%s", IdleHook, (Idle ? "on" : "off"), DevPath); + isyslog("dynamite: calling idle hook %s", *idleHookCmd); + int status = SystemExec(*idleHookCmd, false); + if (!WIFEXITED(status) || WEXITSTATUS(status)) + esyslog("SystemExec() failed with status %d", status); } eDynamicDeviceReturnCode cDynamicDevice::SetIdle(const char *DevPath, bool Idle) diff --git a/dynamite.c b/dynamite.c index 914c1ea..2519ab9 100644 --- a/dynamite.c +++ b/dynamite.c @@ -10,7 +10,7 @@ #include "menu.h" #include "monitor.h" -static const char *VERSION = "0.0.8b"; +static const char *VERSION = "0.0.8c"; static const char *DESCRIPTION = tr("attach/detach devices on the fly"); static const char *MAINMENUENTRY = NULL; -- cgit v1.2.3