From: Scott James Remnant Date: Tue, 24 Mar 2009 12:15:38 +0000 (+0100) Subject: blkid: fix exit codes in blkid(8) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=324759d63ea9ae8ef5b3fa69b607d1eb77fa1a82;p=util-linux blkid: fix exit codes in blkid(8) Signed-off-by: Karel Zak --- 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