Commit ba967183 authored by Daan Vreeken's avatar Daan Vreeken
Browse files

Fix missing check of return value of controller_block_link().

This caused all my .ctrl files with typos or non-existing block names in their
'links { }' section to 'just run' instead of failing with an error.
We will now halt with an error like :

 DEBUG: Input block 'digg_out2' does not (yet) exist, will try to link later
 ERROR: Failed to link controller!
 ERROR: Could not load controller file

	modified:   controller/controller_load.c
parent 3b95f7cc
......@@ -726,6 +726,7 @@ int controller_load(char *filename)
struct controller_load_extra extra;
char *saved_context;
yyscan_t scanner;
int ret;
extra.filename = filename;
extra.ret = 0;
......@@ -756,7 +757,11 @@ int controller_load(char *filename)
yylex_destroy(scanner);
fclose(extra.input_file);
controller_block_link();
ret = controller_block_link();
if (ret != 0) {
log_send(LOG_T_ERROR, "Failed to link controller!");
return ret;
}
err_nofile:
return extra.ret;
......
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