]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
afs: Make catblob commands print an error if no blob matched.
authorAndre Noll <maan@systemlinux.org>
Wed, 6 Jul 2011 20:32:06 +0000 (22:32 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 6 Nov 2011 11:29:13 +0000 (12:29 +0100)
This is straight-forward given the new generic num_matches
counter which was introduced in the previous patch.

blob.c

diff --git a/blob.c b/blob.c
index b3daf5c35744c5727ab8a8f52f127b83c1454073..21144d851a48d8a3d6c2fb16eb792adea5c87a1e 100644 (file)
--- 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);
                .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,
 }
 
 static int com_catblob(callback_function *f, struct stream_cipher_context *scc, int argc,