Package: ppl / 0.10.2-8

9b0ba93300fb829608d40e766b9f3f95c81962e1.debian 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
From: Roberto Bagnara <bagnara@cs.unipr.it>
Date: Sun, 21 Feb 2010 11:49:16 +0000 (+0100)
Subject: sigaction() is also needed, in addition to setitimer() in order to support Watchdog... 
X-Git-Url: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl%2Fppl.git;a=commitdiff_plain;h=9b0ba93300fb829608d40e766b9f3f95c81962e1

sigaction() is also needed, in addition to setitimer() in order to support Watchdog objects.
We could check if signal() is available if there is request for such a feature.
---

diff --git a/Watchdog/src/Watchdog.cc b/Watchdog/src/Watchdog.cc
index 84ccda3..93449be 100644
--- a/Watchdog/src/Watchdog.cc
+++ b/Watchdog/src/Watchdog.cc
@@ -26,7 +26,7 @@ site: http://www.cs.unipr.it/ppl/ . */
 
 namespace PWL = Parma_Watchdog_Library;
 
-#if PWL_HAVE_DECL_SETITIMER
+#if PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 #include <csignal>
 #include <iostream>
@@ -244,4 +244,4 @@ PWL::Watchdog::finalize() {
 
 unsigned int PWL::Init::count = 0;
 
-#endif // PWL_HAVE_DECL_SETITIMER
+#endif // PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
diff --git a/Watchdog/src/Watchdog.defs.hh b/Watchdog/src/Watchdog.defs.hh
index 674954d..7e0f6f5 100644
--- a/Watchdog/src/Watchdog.defs.hh
+++ b/Watchdog/src/Watchdog.defs.hh
@@ -61,7 +61,7 @@ public:
   Watchdog(int units, void (*function)());
   ~Watchdog();
 
-#if PWL_HAVE_DECL_SETITIMER
+#if PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 private:
   friend class Init;
@@ -133,10 +133,10 @@ private:
 
   friend void PWL_handle_timeout(int signum);
 
-#endif // PWL_HAVE_DECL_SETITIMER
+#endif // PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 };
 
-#if PWL_HAVE_DECL_SETITIMER
+#if PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 class Init {
 private:
@@ -151,13 +151,13 @@ public:
   ~Init();
 };
 
-#endif // PWL_HAVE_DECL_SETITIMER
+#endif // PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 } // namespace Parma_Watchdog_Library
 
 #include "Watchdog.inlines.hh"
 
-#if PWL_HAVE_DECL_SETITIMER
+#if PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 namespace {
 
@@ -165,7 +165,7 @@ Parma_Watchdog_Library::Init Parma_Watchdog_Library_initializer;
 
 } // namespace
 
-#endif // PWL_HAVE_DECL_SETITIMER
+#endif // PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 #endif // !defined(PWL_Watchdog_defs_hh)
 
diff --git a/Watchdog/src/Watchdog.inlines.hh b/Watchdog/src/Watchdog.inlines.hh
index 6cdd654..6591359 100644
--- a/Watchdog/src/Watchdog.inlines.hh
+++ b/Watchdog/src/Watchdog.inlines.hh
@@ -29,7 +29,7 @@ site: http://www.cs.unipr.it/ppl/ . */
 
 namespace Parma_Watchdog_Library {
 
-#if PWL_HAVE_DECL_SETITIMER
+#if PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION
 
 template <typename Flag_Base, typename Flag>
 Watchdog::Watchdog(int units, const Flag_Base* volatile& holder, Flag& flag)
@@ -89,7 +89,7 @@ Init::~Init() {
   }
 }
 
-#else // !PWL_HAVE_DECL_SETITIMER
+#else // !PWL_HAVE_DECL_SETITIMER !! !PWL_HAVE_DECL_SIGACTION
 
 template <typename Flag_Base, typename Flag>
 Watchdog::Watchdog(int /* units */,
@@ -109,7 +109,7 @@ inline
 Watchdog::~Watchdog() {
 }
 
-#endif // !PWL_HAVE_DECL_SETITIMER
+#endif // !PWL_HAVE_DECL_SETITIMER !! !PWL_HAVE_DECL_SIGACTION
 
 } // namespace Parma_Watchdog_Library
 
diff --git a/Watchdog/src/pwl_header.hh b/Watchdog/src/pwl_header.hh
index 3a65df6..8df3a05 100644
--- a/Watchdog/src/pwl_header.hh
+++ b/Watchdog/src/pwl_header.hh
@@ -32,7 +32,8 @@ site: http://www.cs.unipr.it/ppl/ . */
 #include "pwl_include_files.hh"
 
 //! Defined to 1 if PWL::Watchdog objects are supported, to 0 otherwise.
-#define PWL_WATCHDOG_OBJECTS_ARE_SUPPORTED PWL_HAVE_DECL_SETITIMER
+#define PWL_WATCHDOG_OBJECTS_ARE_SUPPORTED \
+  (PWL_HAVE_DECL_SETITIMER && PWL_HAVE_DECL_SIGACTION)
 
 #ifdef PWL_SAVE_NDEBUG
 # ifndef NDEBUG