Implement subscription with a signal

Use a signal for subscription events
Work on handling OOM errors and other errors.
This commit is contained in:
Wim Taymans 2016-12-22 16:50:01 +01:00
parent 1b66bbcffd
commit 85d375e4bb
32 changed files with 531 additions and 176 deletions

View file

@ -68,6 +68,8 @@ parse_command_module_load (const char * line, char ** err)
PinosCommandImpl *impl;
impl = calloc (1, sizeof (PinosCommandImpl));
if (impl == NULL)
goto no_mem;
impl->func = execute_command_module_load;
impl->args = pinos_split_strv (line, whitespace, 3, &impl->n_args);
@ -83,6 +85,9 @@ no_module:
asprintf (err, "%s requires a module name", impl->args[0]);
pinos_free_strv (impl->args);
return NULL;
no_mem:
asprintf (err, "no memory");
return NULL;
}
static bool
@ -125,7 +130,7 @@ pinos_command_free (PinosCommand * command)
* Returns: The command or %NULL when @err is set.
*/
PinosCommand *
pinos_command_parse (const char *line,
pinos_command_parse (const char *line,
char **err)
{
PinosCommand *command = NULL;