#! /bin/sh /usr/share/dpatch/dpatch-run
## 99_vdr-workaround-broken-sys-capability.dpatch by Anssi Hannula <anssi.hannula@gmail.com>
## http://www.linuxtv.org/pipermail/vdr/2009-August/021196.html
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This is a workaround for some trouble with the kernel headers
## DP: in Linux 2.6.29.
## DP: See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523424
@DPATCH@
Index: vdr-1.7.9/vdr.c
===================================================================
--- vdr-1.7.9/vdr.c
+++ vdr-1.7.9/vdr.c 2009-08-23 23:26:15.935332431 +0300
@@ -32,7 +32,6 @@
#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
-#include <sys/capability.h>
#include <sys/prctl.h>
#include <termios.h>
#include <unistd.h>
@@ -64,6 +63,9 @@
#include "tools.h"
#include "transfer.h"
#include "videodir.h"
+// include this one last due to some versions of it being buggy:
+// http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
+#include <sys/capability.h>
#define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping