X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=blob.c;fp=blob.c;h=5e9fe75553e5a331eeb1d7630e50516c8cfe05fb;hb=76b2c831235944aa6d08da4f7001bf9214075a4f;hp=e43d194dd58da5c62ced9f52b65557109c2b081c;hpb=539462ba5d5e6a5aea5cdc786085d40c4d94abc2;p=paraslash.git diff --git a/blob.c b/blob.c index e43d194d..5e9fe755 100644 --- a/blob.c +++ b/blob.c @@ -223,6 +223,7 @@ static int cat_blob(struct osl_table *table, struct osl_row *row, 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, @@ -232,12 +233,12 @@ static int com_catblob_callback(struct osl_table *table, int fd, .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)