From: Andre Noll Date: Wed, 6 Jul 2011 20:32:06 +0000 (+0200) Subject: afs: Make catblob commands print an error if no blob matched. X-Git-Tag: v0.4.9~3^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b326b33f0afef8f68623d30fff936d615ce43bc7 afs: Make catblob commands print an error if no blob matched. This is straight-forward given the new generic num_matches counter which was introduced in the previous patch. --- diff --git a/blob.c b/blob.c index b3daf5c3..21144d85 100644 --- a/blob.c +++ b/blob.c @@ -223,6 +223,10 @@ static void com_catblob_callback(struct osl_table *table, int fd, .action = cat_blob }; for_each_matching_row(&pmd); + if (pmd.num_matches == 0) { + char err_msg[] = "no matches\n"; + pass_buffer_as_shm(err_msg, sizeof(err_msg), &fd); + } } static int com_catblob(callback_function *f, struct stream_cipher_context *scc, int argc,