X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-supervision.c;h=4d471e86b34ebde79fc2126051bbec0058d7c632;hb=428dd77c7ef528dd1769d7c9bb95cd0fb2eaf2a8;hp=0f8a16bb16b55dc1ecafd4be2310901eb67f98ae;hpb=ca820c65c2b03a24e8936218171c6c1d138fd1f7;p=src%2Fapp-framework-binder.git diff --git a/src/afb-supervision.c b/src/afb-supervision.c index 0f8a16bb..4d471e86 100644 --- a/src/afb-supervision.c +++ b/src/afb-supervision.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 "IoT.bzh" + * Copyright (C) 2016, 2017, 2018 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -51,7 +51,8 @@ extern struct afb_config *main_config; /* api and apiset name */ -static const char supervision_apiname[] = AFS_SURPERVISION_APINAME_INTERNAL; +static const char supervision_apiname[] = AFS_SURPERVISION_APINAME; +static const char supervisor_apiname[] = AFS_SURPERVISOR_APINAME; /* path of the supervision socket */ static const char supervisor_socket_path[] = AFS_SURPERVISION_SOCKET; @@ -291,7 +292,6 @@ static const char *verbs[] = { "break", "config", "do", "exit", "sclose", "slist", "trace", "wait" }; enum { Break , Config , Do , Exit , Sclose , Slist , Trace , Wait }; - static void on_supervision_call(void *closure, struct afb_xreq *xreq) { int i, rc; @@ -316,7 +316,7 @@ static void on_supervision_call(void *closure, struct afb_xreq *xreq) i = 0; if (wrap_json_unpack(args, "i", &i)) wrap_json_unpack(args, "{si}", "code", &i); - ERROR("existing from supervision with code %d -> %d", i, i & 127); + ERROR("exiting from supervision with code %d -> %d", i, i & 127); exit(i & 127); break; case Sclose: @@ -347,9 +347,10 @@ static void on_supervision_call(void *closure, struct afb_xreq *xreq) break; case Trace: if (!trace) - trace = afb_trace_create(supervision_apiname, NULL /* not bound to any session */); + trace = afb_trace_create(supervisor_apiname, NULL /* not bound to any session */); - req = afb_xreq_unstore((struct afb_stored_req*)xreq); + req = xreq_to_req(xreq); + add = drop = NULL; wrap_json_unpack(args, "{s?o s?o}", "add", &add, "drop", &drop); if (add) { rc = afb_trace_add(req, add, trace);