From 324759d63ea9ae8ef5b3fa69b607d1eb77fa1a82 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Tue, 24 Mar 2009 13:15:38 +0100 Subject: [PATCH] blkid: fix exit codes in blkid(8) Signed-off-by: Karel Zak --- libs/blkid/bin/blkid.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/blkid/bin/blkid.c b/libs/blkid/bin/blkid.c index 92183212..620344e4 100644 --- a/libs/blkid/bin/blkid.c +++ b/libs/blkid/bin/blkid.c @@ -528,11 +528,13 @@ int main(int argc, char **argv) if (!lowprobe && !eval && blkid_get_cache(&cache, read) < 0) goto exit; - err = 2; if (gc) { blkid_gc_cache(cache); + err = 0; goto exit; } + err = 2; + if (output_format & OUTPUT_PRETTY_LIST) pretty_print_dev(NULL); @@ -566,8 +568,10 @@ int main(int argc, char **argv) * Evaluate API */ char *res = blkid_evaluate_spec(search_type, search_value, NULL); - if (res) + if (res) { + err = 0; printf("%s\n", res); + } } else if (lookup) { /* * Classic (cache based) API -- 2.39.5