Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Avoid lock when child dies
[src/app-framework-binder.git]
/
src
/
main-afs-supervisor.c
diff --git
a/src/main-afs-supervisor.c
b/src/main-afs-supervisor.c
index
6daaf64
..
e56e1d8
100644
(file)
--- a/
src/main-afs-supervisor.c
+++ b/
src/main-afs-supervisor.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2016
, 2017, 2018
"IoT.bzh"
+ * Copyright (C) 2016
-2019
"IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-34,18
+34,19
@@
#include "afb-session.h"
#include "afs-supervisor.h"
#include "afb-session.h"
#include "afs-supervisor.h"
-#include "afs-
config
.h"
+#include "afs-
args
.h"
#include "verbose.h"
#include "jobs.h"
#include "process-name.h"
#include "verbose.h"
#include "jobs.h"
#include "process-name.h"
+#include "watchdog.h"
#if !defined(DEFAULT_SUPERVISOR_INTERFACE)
# define DEFAULT_SUPERVISOR_INTERFACE NULL
#endif
/* the main config */
#if !defined(DEFAULT_SUPERVISOR_INTERFACE)
# define DEFAULT_SUPERVISOR_INTERFACE NULL
#endif
/* the main config */
-struct afs_
config
*main_config;
+struct afs_
args
*main_config;
/* the main apiset */
struct afb_apiset *main_apiset;
/* the main apiset */
struct afb_apiset *main_apiset;
@@
-191,6
+192,14
@@
static void start(int signum, void *arg)
/* ready */
sd_notify(1, "READY=1");
/* ready */
sd_notify(1, "READY=1");
+
+ /* activate the watchdog */
+#if HAS_WATCHDOG
+ if (watchdog_activate() < 0)
+ ERROR("can't start the watchdog");
+#endif
+
+ /* discover binders */
afs_supervisor_discover();
return;
error:
afs_supervisor_discover();
return;
error:
@@
-203,7
+212,7
@@
error:
int main(int ac, char **av)
{
/* scan arguments */
int main(int ac, char **av)
{
/* scan arguments */
- main_config = afs_
config_parse_arguments
(ac, av);
+ main_config = afs_
args_parse
(ac, av);
if (main_config->name) {
verbose_set_name(main_config->name, 0);
process_name_set_name(main_config->name);
if (main_config->name) {
verbose_set_name(main_config->name, 0);
process_name_set_name(main_config->name);