diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-06-02 14:37:35 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-06-02 14:37:35 +0200 |
commit | 8ed4166fe1e1d24c174ae53101159853709b1346 (patch) | |
tree | 183290af4eff508147a35a3611a1c476750c271a | |
parent | cc83f1893aa03e639dfa57ff58ce9f9875461b66 (diff) |
Fix error on initialisation
Change-Id: If6a988359b4d2747cefdd683b6328f5b36e37548
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/jobs.c | 2 | ||||
-rw-r--r-- | src/jobs.h | 2 | ||||
-rw-r--r-- | src/main.c | 7 | ||||
-rw-r--r-- | src/sig-monitor.c | 3 |
4 files changed, 8 insertions, 6 deletions
@@ -689,7 +689,7 @@ struct sd_event *jobs_get_sd_event() * @param start The start routine to activate (can't be NULL) * @return 0 in case of success or -1 in case of error. */ -int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)()) +int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)(int signum)) { int rc, launched; struct thread me; @@ -44,5 +44,5 @@ extern struct sd_event *jobs_get_sd_event(); extern void jobs_terminate(); -extern int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)()); +extern int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)(int signum)); @@ -529,10 +529,15 @@ static void run_startup_calls() | job for starting the daemon +--------------------------------------------------------- */ -static void start() +static void start(int signum) { struct afb_hsrv *hsrv; + if (signum) { + ERROR("start aborted: received signal %s", strsignal(signum)); + exit(1); + } + // ------------------ sanity check ---------------------------------------- if (config->httpdPort <= 0) { ERROR("no port is defined"); diff --git a/src/sig-monitor.c b/src/sig-monitor.c index ce0a4cd0..aaffaed0 100644 --- a/src/sig-monitor.c +++ b/src/sig-monitor.c @@ -187,6 +187,3 @@ void sig_monitor(int timeout, void (*function)(int sig, void*), void *arg) } - - - |