From b326b33f0afef8f68623d30fff936d615ce43bc7 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 6 Jul 2011 22:32:06 +0200 Subject: [PATCH] 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. --- blob.c | 4 ++++ 1 file changed, 4 insertions(+) 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, -- 2.39.2