Commit 7f43a10d authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

When parsing a control file failes on non syntax errors we should stop parsing

the file.
parent e0cadc03
......@@ -56,7 +56,7 @@ int controller_block_create(char *type, char *name, va_list ap)
handle = dlopen(NULL, RTLD_NOW);
if (!handle) {
log_send(LOG_T_ERROR,
"Error getting handle from dlopen(): %s", dlerror());
"Could not get handle from dlopen(): %s", dlerror());
return -1;
}
......@@ -67,12 +67,12 @@ int controller_block_create(char *type, char *name, va_list ap)
if (create_func) {
if(!create_func(name, ap)) {
log_send(LOG_T_ERROR, "Error: %s() failed", symbol);
log_send(LOG_T_ERROR, "%s() failed", symbol);
ret = -1;
}
} else {
log_send(LOG_T_ERROR,
"Error finding function %s for block %s", symbol, type);
"Could not find function %s for block %s", symbol, type);
ret = -1;
}
......
......@@ -124,8 +124,10 @@ block : BRACEOPENSYM
STRINGSYM varlist
BRACECLOSESYM
{
if(controller_load_block_create($2, $4, scanner))
if(controller_load_block_create($2, $4, scanner)) {
yyerror(scanner, "Error creating block");
YYERROR;
}
free($2);
free($4);
controller_load_var_clear(scanner);
......@@ -144,8 +146,10 @@ param : BRACEOPENSYM
varlist
BRACECLOSESYM
{
if (controller_load_block_param_set($2, $4, scanner))
if (controller_load_block_param_set($2, $4, scanner)) {
yyerror(scanner, "Error setting parameter");
YYERROR;
}
controller_load_var_clear(scanner);
}
;
......@@ -249,8 +253,10 @@ link : BRACEOPENSYM
BOOLSYM
BRACECLOSESYM
{
if (controller_block_connect($2, $4, $6, $8, $10))
if (controller_block_connect($2, $4, $6, $8, $10)) {
yyerror(scanner, "Error connecting blocks");
YYERROR;
}
free($2);
free($4);
free($6);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment