Package: opensips / 2.2.2-3.1

fix-timerfd-check.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Enable timerfd only if header exists.
Author: Răzvan Crainea <razvan@opensips.org>
Last-Update: 2016-12-07
--- a/modules/cfgutils/Makefile
+++ b/modules/cfgutils/Makefile
@@ -5,6 +5,10 @@
 # 
 # WARNING: do not run this directly, it should be run by the master Makefile
 
+ifneq ($(wildcard /usr/include/sys/timerfd.h),)
+	DEFS+=-DHAVE_TIMERFD_FILE
+endif
+
 include ../../Makefile.defs
 auto_gen=
 NAME=cfgutils.so
--- a/modules/cfgutils/cfgutils.c
+++ b/modules/cfgutils/cfgutils.c
@@ -59,7 +59,7 @@
 #include "env_var.h"
 #include "script_locks.h"
 
-#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 8)
+#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 8) && (defined HAVE_TIMERFD_FILE)
 	#include <sys/timerfd.h>  /* for timer FD */
 	#define HAVE_TIMER_FD 1
 #else