X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fjobs.c;h=42f2fbe709d93580eb2bac81337b044f2ce67225;hb=e12c3008f10cf5d61cc3235af6562a007ff08e76;hp=952720bd78cd3f1a9cac0f96f9fd6d09c1e25741;hpb=098d6d3c8fb0aff78528746115d0f481da76e5fb;p=src%2Fapp-framework-binder.git diff --git a/src/jobs.c b/src/jobs.c index 952720bd..42f2fbe7 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 "IoT.bzh" + * Copyright (C) 2016, 2017, 2018 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +17,12 @@ #define _GNU_SOURCE +#if defined(NO_JOBS_WATCHDOG) +# define HAS_WATCHDOG 0 +#else +# define HAS_WATCHDOG 1 +#endif + #include #include #include @@ -29,7 +35,7 @@ #include #include -#ifndef NO_JOBS_WATCHDOG +#if HAS_WATCHDOG #include #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);