From a4b8729e6af299a3f2eb4fa676e93cfd85778521 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 16 Mar 2014 12:53:47 +0100 Subject: Added support for systemd --- CONTRIBUTORS | 1 + HISTORY | 2 ++ Makefile | 7 ++++++- vdr.c | 9 ++++++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index cb990fcd..304be837 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2935,6 +2935,7 @@ Christopher Reimer VDR source directory when doing "make plugins" for reverting the change from version 1.5.7 that made all logging go to LOG_ERR for reporting a possible crash in the OSD demo + for adding support for systemd Stefan Huskamp for suggesting to make entering characters via the number keys diff --git a/HISTORY b/HISTORY index 1ae19904..c2ebc46d 100644 --- a/HISTORY +++ b/HISTORY @@ -8258,3 +8258,5 @@ Video Disk Recorder Revision History - Now resetting the isOnVideoDirectoryFileSystem member of a cRecording to -1 after renaming it, so that it will be re-checked upon the next call to IsOnVideoDirectoryFileSystem(). +- Added support for systemd (thanks to Christopher Reimer). To activate this you + need to add "SDNOTIFY=1" to the 'make' call. diff --git a/Makefile b/Makefile index 0d990bb2..0d3a8fc3 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Makefile 3.1 2013/05/23 10:10:00 kls Exp $ +# $Id: Makefile 3.2 2014/03/16 12:47:35 kls Exp $ .DELETE_ON_ERROR: @@ -93,6 +93,11 @@ INCLUDES += $(shell pkg-config --cflags fribidi) DEFINES += -DBIDI LIBS += $(shell pkg-config --libs fribidi) endif +ifdef SDNOTIFY +INCLUDES += $(shell pkg-config --cflags libsystemd-daemon) +DEFINES += -DSDNOTIFY +LIBS += $(shell pkg-config --libs libsystemd-daemon) +endif LIRC_DEVICE ?= /var/run/lirc/lircd diff --git a/vdr.c b/vdr.c index ff4688ee..835d33df 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 3.10 2014/01/26 12:27:51 kls Exp $ + * $Id: vdr.c 3.11 2014/03/16 12:49:13 kls Exp $ */ #include @@ -34,6 +34,9 @@ #include #include #include +#ifdef SDNOTIFY +#include +#endif #include #include #include "audio.h" @@ -845,6 +848,10 @@ int main(int argc, char *argv[]) alarm(WatchdogTimeout); // Initial watchdog timer start } +#ifdef SDNOTIFY + sd_notify(0, "READY=1"); +#endif + // Main program loop: #define DELETE_MENU ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL) -- cgit v1.2.3