ctrl: use #define for TRAP id

We always use id = 0 when sending TRAP messages. Let's make this more
obvious by introducing appropriate define.

Change-Id: I33d7d4c6a1885a75a85d6f2f017430e0860b4126
This commit is contained in:
Max 2018-11-26 10:38:55 +01:00
parent cb02a391cd
commit 30b2e348df
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
#define CTRL_CMD_ERROR -1
#define CTRL_CMD_HANDLED 0
#define CTRL_CMD_REPLY 1
#define CTRL_CMD_TRAP_ID "0"
struct ctrl_handle;

View File

@ -156,7 +156,7 @@ int ctrl_cmd_send_trap(struct ctrl_handle *ctrl, const char *name, char *value)
if (!cmd)
return -ENOMEM;
cmd->id = "0"; /* It's a TRAP! */
cmd->id = CTRL_CMD_TRAP_ID; /* It's a TRAP! */
cmd->variable = (char *) name;
cmd->reply = value;
r = ctrl_cmd_send_to_all(ctrl, cmd);