afs-supervisor: Fix typo
[src/app-framework-binder.git] / src / afs-supervisor.c
index bf05f8a..62adf9b 100644 (file)
@@ -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");
@@ -60,14 +60,14 @@ struct supervised
 };
 
 /* api and apiset name */
-static const char supervision_apiname[] = AFS_SURPERVISION_APINAME;
-static const char supervisor_apiname[] = AFS_SURPERVISOR_APINAME;
+static const char supervision_apiname[] = AFS_SUPERVISION_APINAME;
+static const char supervisor_apiname[] = AFS_SUPERVISOR_APINAME;
 
 /* the empty apiset */
 static struct afb_apiset *empty_apiset;
 
 /* supervision socket path */
-static const char supervision_socket_path[] = AFS_SURPERVISION_SOCKET;
+static const char supervision_socket_path[] = AFS_SUPERVISION_SOCKET;
 static struct fdev *supervision_fdev;
 
 /* global mutex */
@@ -137,7 +137,7 @@ static int send_initiator(int fd, const char *command)
 
        /* set  */
        memset(&asi, 0, sizeof asi);
-       strcpy(asi.interface, AFS_SURPERVISION_INTERFACE_1);
+       strcpy(asi.interface, AFS_SUPERVISION_INTERFACE_1);
        if (command)
                strncpy(asi.extra, command, sizeof asi.extra - 1);
 
@@ -383,16 +383,19 @@ static void f_session_close(struct afb_req req)
 static void f_exit(struct afb_req req)
 {
        propagate(req, NULL);
+       afb_req_success(req, NULL, NULL);
 }
 
 static void f_debug_wait(struct afb_req req)
 {
        propagate(req, "wait");
+       afb_req_success(req, NULL, NULL);
 }
 
 static void f_debug_break(struct afb_req req)
 {
        propagate(req, "break");
+       afb_req_success(req, NULL, NULL);
 }
 
 /*************************************************************************************/
@@ -451,70 +454,70 @@ static const struct afb_verb_v2 _afb_verbs_v2_supervisor[] = {
         .callback = f_list,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "config",
         .callback = f_config,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "do",
         .callback = f_do,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "trace",
         .callback = f_trace,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "sessions",
         .callback = f_sessions,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "session-close",
         .callback = f_session_close,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "exit",
         .callback = f_exit,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "debug-wait",
         .callback = f_debug_wait,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "debug-break",
         .callback = f_debug_break,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     {
         .verb = "discover",
         .callback = f_discover,
         .auth = &_afb_auths_v2_supervisor[0],
         .info = NULL,
-        .session = AFB_SESSION_NONE_V2
+        .session = AFB_SESSION_CHECK_V2
     },
     { .verb = NULL }
 };