Commit 6d3ff22b authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Merge branch '10-add-a-command-to-request-the-shutdown-of-the-service' into 'master'

Resolve "Add a command to request the shutdown of the service"

Closes #10, #16, and #15

See merge request !5
parents 5139cacb 3e6b5672
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -63,11 +63,13 @@ extern "C" {
/* errors about namespaces */
#define NORNS_ENAMESPACEEXISTS   -30
#define NORNS_ENOSUCHNAMESPACE   -31
#define NORNS_ENAMESPACENOTEMPTY -32

/* errors about tasks */
#define NORNS_ETASKEXISTS        -40
#define NORNS_ENOSUCHTASK        -41
#define NORNS_ETOOMANYTASKS      -42
#define NORNS_ETASKSPENDING      -43

/* task status */
#define NORNS_EPENDING          -100
+4 −3
Original line number Diff line number Diff line
@@ -40,9 +40,10 @@ typedef uint32_t nornsctl_backend_flags_t;

/* Administrative command IDs valid for nornsctl_send_command() */
typedef enum {
    NORNSCTL_COMMAND_PING = 1000,
    NORNSCTL_COMMAND_PAUSE_ACCEPT,
    NORNSCTL_COMMAND_RESUME_ACCEPT,
    NORNSCTL_CMD_PING = 1000,
    NORNSCTL_CMD_PAUSE_LISTEN,
    NORNSCTL_CMD_RESUME_LISTEN,
    NORNSCTL_CMD_SHUTDOWN,
} nornsctl_command_t;


+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ send_control_command_request(nornsctl_command_t cmd, void* args) {
        return NORNS_ESNAFU;
    }

    return NORNS_SUCCESS;
    return resp.r_error_code;
}


+2 −0
Original line number Diff line number Diff line
@@ -53,11 +53,13 @@ const char* const norns_errlist[NORNS_ERRMAX + 1] = {
    /* backend errors */
    [ERR_REMAP(NORNS_ENAMESPACEEXISTS)] = "Namespace already exists",
    [ERR_REMAP(NORNS_ENOSUCHNAMESPACE)] = "Namespace does not exist",
    [ERR_REMAP(NORNS_ENAMESPACENOTEMPTY)] = "Namespace is not empty",
    
    /* task errors */
    [ERR_REMAP(NORNS_ETASKEXISTS)] = "Task already exists",
    [ERR_REMAP(NORNS_ENOSUCHTASK)] = "Task does not exist",
    [ERR_REMAP(NORNS_ETOOMANYTASKS)] = "Too many pending tasks",
    [ERR_REMAP(NORNS_ETASKSPENDING)] = "There are still pending tasks",

    /* misc errors */
    [ERR_REMAP(NORNS_ENOTSUPPORTED)] = "Not supported",
+13 −12
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ config/defaults.cpp: Makefile
	   echo ""; \
\
	   echo "    const bool dry_run               = false;"; \
	   echo "    const uint32_t dry_run_duration  = 100;"; \
\
	   echo "    const char* global_socket        = \"$(localstatedir)/global.socket.2\";"; \
	   echo "    const char* control_socket       = \"$(localstatedir)/control.socket.2\";"; \
Loading