aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-03-23 14:01:09 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-06-13 17:13:56 +0200
commite12c3008f10cf5d61cc3235af6562a007ff08e76 (patch)
treeeb4cf9f9970e08e600f279977be85c36d666fefa
parent349bf5c5a91991b791b205df83bf021f8ef0c062 (diff)
jobs: Cosmetic changes
Change-Id: I7505c3c5bcec9e2b7af645a59a3716cf9bfec552 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/jobs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 6eff0145..42f2fbe7 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -17,6 +17,12 @@
#define _GNU_SOURCE
+#if defined(NO_JOBS_WATCHDOG)
+# define HAS_WATCHDOG 0
+#else
+# define HAS_WATCHDOG 1
+#endif
+
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
@@ -29,7 +35,7 @@
#include <sys/eventfd.h>
#include <systemd/sd-event.h>
-#ifndef NO_JOBS_WATCHDOG
+#if HAS_WATCHDOG
#include <systemd/sd-daemon.h>
#endif
@@ -38,7 +44,7 @@
#include "verbose.h"
#if 0
-#define _alert_ "do you really want to remove monitoring?"
+#define _alert_ "do you really want to remove signal monitoring?"
#define sig_monitor_init_timeouts() ((void)0)
#define sig_monitor_clean_timeouts() ((void)0)
#define sig_monitor(to,cb,arg) (cb(0,arg))
@@ -144,7 +150,7 @@ static struct job *job_create(
if (job)
free_jobs = job->next;
else {
- /* allocation without blocking */
+ /* allocation without blocking */
pthread_mutex_unlock(&mutex);
job = malloc(sizeof *job);
pthread_mutex_lock(&mutex);
@@ -765,7 +771,7 @@ int jobs_start(int allowed_count, int start_count, int waiter_count, void (*star
running = 0;
remains = waiter_count;
-#ifndef NO_JOBS_WATCHDOG
+#if HAS_WATCHDOG
/* set the watchdog */
if (sd_watchdog_enabled(0, NULL))
sd_event_set_watchdog(get_sd_event_locked(), 1);