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
afb-trace: Restore microsecond time
[src/app-framework-binder.git]
/
src
/
afb-supervision.c
diff --git
a/src/afb-supervision.c
b/src/afb-supervision.c
index
1ff8f8b
..
f1024c3
100644
(file)
--- 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 <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");
@@
-51,10
+51,11
@@
extern struct afb_config *main_config;
/* api and apiset name */
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_SUPERVISION_APINAME;
+static const char supervisor_apiname[] = AFS_SUPERVISOR_APINAME;
/* path of the supervision socket */
/* path of the supervision socket */
-static const char supervisor_socket_path[] = AFS_SU
R
PERVISION_SOCKET;
+static const char supervisor_socket_path[] = AFS_SUPERVISION_SOCKET;
/* mutual exclusion */
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
/* mutual exclusion */
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@
-161,7
+162,7
@@
static void try_connect_supervisor()
goto end;
}
goto end;
}
- /* nego
c
iation */
+ /* nego
t
iation */
do { srd = read(fd, &initiator, sizeof initiator); } while(srd < 0 && errno == EINTR);
if (srd < 0) {
NOTICE("Can't read supervisor %s: %m", supervisor_socket_path);
do { srd = read(fd, &initiator, sizeof initiator); } while(srd < 0 && errno == EINTR);
if (srd < 0) {
NOTICE("Can't read supervisor %s: %m", supervisor_socket_path);
@@
-175,7
+176,7
@@
static void try_connect_supervisor()
ERROR("Bad interface of supervisor %s", supervisor_socket_path);
goto end2;
}
ERROR("Bad interface of supervisor %s", supervisor_socket_path);
goto end2;
}
- if (strcmp(initiator.interface, AFS_SU
R
PERVISION_INTERFACE_1)) {
+ if (strcmp(initiator.interface, AFS_SUPERVISION_INTERFACE_1)) {
ERROR("Unknown interface %s for supervisor %s", initiator.interface, supervisor_socket_path);
goto end2;
}
ERROR("Unknown interface %s for supervisor %s", initiator.interface, supervisor_socket_path);
goto end2;
}
@@
-231,7
+232,7
@@
static void on_sighup(int signum)
}
/**
}
/**
- * initalize the supervision
+ * init
i
alize the supervision
*/
int afb_supervision_init()
{
*/
int afb_supervision_init()
{
@@
-315,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);
i = 0;
if (wrap_json_unpack(args, "i", &i))
wrap_json_unpack(args, "{si}", "code", &i);
- ERROR("exi
s
ting 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:
exit(i & 127);
break;
case Sclose:
@@
-346,7
+347,7
@@
static void on_supervision_call(void *closure, struct afb_xreq *xreq)
break;
case Trace:
if (!trace)
break;
case Trace:
if (!trace)
- trace = afb_trace_create(supervis
ion
_apiname, NULL /* not bound to any session */);
+ trace = afb_trace_create(supervis
or
_apiname, NULL /* not bound to any session */);
req = xreq_to_req(xreq);
add = drop = NULL;
req = xreq_to_req(xreq);
add = drop = NULL;