aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-09-06 08:25:47 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2018-09-06 08:25:47 +0000
commite11e8fbe65c6d57716c96bc6dd2b503a310dca67 (patch)
tree0c34f095ad4a32cbd0c3185693937d65d1a3d7c0
parent408acbdce381f1e70985eae9f96d036689f3d0aa (diff)
parent72385abda940862a920442a330fb6aa82673400f (diff)
Merge "main-afb-daemon: Export API after initialization"
-rw-r--r--src/afb-socket.c2
-rw-r--r--src/jobs.c2
-rw-r--r--src/main-afb-daemon.c10
3 files changed, 9 insertions, 5 deletions
diff --git a/src/afb-socket.c b/src/afb-socket.c
index ebbc58ec..77b5edf8 100644
--- a/src/afb-socket.c
+++ b/src/afb-socket.c
@@ -217,7 +217,7 @@ static int open_systemd(const char *spec)
{
#if defined(NO_SYSTEMD_ACTIVATION)
errno = EAFNOSUPPORT;
- fd = -1;
+ return -1;
#else
return afb_systemd_fds_for(spec);
#endif
diff --git a/src/jobs.c b/src/jobs.c
index a6357c87..9768f269 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -160,7 +160,7 @@ static struct job *job_create(
job = malloc(sizeof *job);
pthread_mutex_lock(&mutex);
if (!job) {
- errno = -ENOMEM;
+ errno = ENOMEM;
goto end;
}
}
diff --git a/src/main-afb-daemon.c b/src/main-afb-daemon.c
index 06aeb58d..77d7ab29 100644
--- a/src/main-afb-daemon.c
+++ b/src/main-afb-daemon.c
@@ -761,15 +761,13 @@ static void start(int signum, void *arg)
if (traceglob)
afb_hook_create_global(afb_hook_flags_global_from_text(traceglob), NULL, NULL);
- /* load bindings */
+ /* load bindings and apis */
afb_debug("start-load");
apiset_start_list("binding", afb_api_so_add_binding, "the binding");
apiset_start_list("ldpaths", afb_api_so_add_pathset_fails, "the binding path set");
apiset_start_list("weak-ldpaths", afb_api_so_add_pathset_nofails, "the weak binding path set");
apiset_start_list("auto-api", afb_autoset_add_any, "the automatic api path set");
- apiset_start_list("ws-server", afb_api_ws_add_server, "the afb-websocket service");
#if defined(WITH_DBUS_TRANSPARENCY)
- apiset_start_list("dbus-server", afb_api_dbus_add_server, "the afb-dbus service");
apiset_start_list("dbus-client", afb_api_dbus_add_client, "the afb-dbus client");
#endif
apiset_start_list("ws-client", afb_api_ws_add_client_weak, "the afb-websocket client");
@@ -784,6 +782,12 @@ static void start(int signum, void *arg)
if (afb_apiset_start_all_services(main_apiset) < 0)
goto error;
+ /* export started apis */
+ apiset_start_list("ws-server", afb_api_ws_add_server, "the afb-websocket service");
+#if defined(WITH_DBUS_TRANSPARENCY)
+ apiset_start_list("dbus-server", afb_api_dbus_add_server, "the afb-dbus service");
+#endif
+
/* start the HTTP server */
afb_debug("start-http");
if (!no_httpd) {