tree-wide: print error if table_print() fails
We generally want to print an error message if table_print() fails. Add a helper function for this and use it consistently. This does one of the three things depending on the call site: - a no-change reformatting of the code - change from a custom message to the generic one - addition of the error message where previously none was printed In the third case, the actual use impact is very small, since the table formatting is very unlikely to fail. But if it did, we would often return an error without any message whatsoever, which we never want to do.
This commit is contained in:
@@ -128,11 +128,7 @@ int parse_signal_argument(const char *s, int *ret) {
|
||||
return table_log_add_error(r);
|
||||
}
|
||||
|
||||
r = table_print(table);
|
||||
if (r < 0)
|
||||
return table_log_print_error(r);
|
||||
|
||||
return 0;
|
||||
return table_print_or_warn(table);
|
||||
}
|
||||
|
||||
r = signal_from_string(s);
|
||||
|
||||
Reference in New Issue
Block a user