aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
}
-
-
-