static int com_catblob_callback(struct osl_table *table, int fd,
const struct osl_object *query)
{
+ int ret;
struct pattern_match_data pmd = {
.table = table,
.patterns = *query,
.data = &fd,
.action = cat_blob
};
- for_each_matching_row(&pmd);
- if (pmd.num_matches == 0) {
- char err_msg[] = "no matches\n";
- pass_buffer_as_shm(fd, SBD_OUTPUT, err_msg, sizeof(err_msg));
- }
- return 0;
+ ret = for_each_matching_row(&pmd);
+ if (ret < 0)
+ return ret;
+ if (pmd.num_matches == 0)
+ ret = -E_NO_MATCH;
+ return ret;
}
static int com_catblob(callback_function *f, struct command_context *cc)