aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-06-02 14:37:35 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-06-02 14:37:35 +0200
commit8ed4166fe1e1d24c174ae53101159853709b1346 (patch)
tree183290af4eff508147a35a3611a1c476750c271a
parentcc83f1893aa03e639dfa57ff58ce9f9875461b66 (diff)
Fix error on initialisation
Change-Id: If6a988359b4d2747cefdd683b6328f5b36e37548 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/jobs.c2
-rw-r--r--src/jobs.h2
-rw-r--r--src/main.c7
-rw-r--r--src/sig-monitor.c3
4 files changed, 8 insertions, 6 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 8725d00e..1e84c824 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -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;
diff --git a/src/jobs.h b/src/jobs.h
index 49f45dd5..f461342c 100644
--- a/src/jobs.h
+++ b/src/jobs.h
@@ -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));
diff --git a/src/main.c b/src/main.c
index fc1ec13e..6b89aef1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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)
}
-
-
-