Don't hardcode lirc socket path in the sky plugin

Message ID 200911222309.36254.ville.skytta@iki.fi
State New
Headers

Commit Message

Ville Skyttä Nov. 22, 2009, 9:09 p.m. UTC
  Hello,

The attached patch avoids hardcoded lirc socket path in the sky plugin, making 
it use the value from Make.config by default.  The patch is against 1.6.0-2 
but appears to apply cleanly to 1.7.10 as well.
  

Comments

Klaus Schmidinger Dec. 5, 2009, 2:29 p.m. UTC | #1
On 22.11.2009 22:09, Ville Skyttä wrote:
> Hello,
> 
> The attached patch avoids hardcoded lirc socket path in the sky plugin, making 
> it use the value from Make.config by default.  The patch is against 1.6.0-2 
> but appears to apply cleanly to 1.7.10 as well.

The 'sky' plugin will no longer be part of the VDR source as of version 1.7.11.

Klaus
  

Patch

diff -up vdr-1.6.0/PLUGINS/src/sky/Makefile~ vdr-1.6.0/PLUGINS/src/sky/Makefile
--- vdr-1.6.0/PLUGINS/src/sky/Makefile~	2008-01-13 15:00:16.000000000 +0200
+++ vdr-1.6.0/PLUGINS/src/sky/Makefile	2009-11-22 22:37:27.000000000 +0200
@@ -41,7 +41,8 @@  PACKAGE = vdr-$(ARCHIVE)
 
 INCLUDES += -I$(VDRDIR)/include
 
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+LIRC_DEVICE ?= /dev/lircd
+DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DLIRC_DEVICE=\"$(LIRC_DEVICE)\"
 
 ### The object files (add further files here):
 
diff -up vdr-1.6.0/PLUGINS/src/sky/sky.c~ vdr-1.6.0/PLUGINS/src/sky/sky.c
--- vdr-1.6.0/PLUGINS/src/sky/sky.c~	2008-03-22 12:19:32.000000000 +0200
+++ vdr-1.6.0/PLUGINS/src/sky/sky.c	2009-11-22 22:33:03.000000000 +0200
@@ -88,7 +88,7 @@  cDigiboxDevice::cDigiboxDevice(void)
   apid = vpid = 0;
   struct sockaddr_un addr;
   addr.sun_family = AF_UNIX;
-  strn0cpy(addr.sun_path, "/dev/lircd", sizeof(addr.sun_path));//XXX parameter???
+  strn0cpy(addr.sun_path, LIRC_DEVICE, sizeof(addr.sun_path));//XXX parameter???
   fd_lirc = socket(AF_UNIX, SOCK_STREAM, 0);
   if (fd_lirc >= 0) {
      if (connect(fd_lirc, (struct sockaddr *)&addr, sizeof(addr)) < 0) {