X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-count.c;h=6058f7c9510d6bdbc15a22c4f24a630eadc50666;hp=01e4e3012b8a07c799418c1c256107bb4e1cffa4;hb=3fed6736a7ef8b8b1f05d0fabb136bdd3b5917ee;hpb=431571242cd08a45757f229d66027afe83446faf diff --git a/notmuch-count.c b/notmuch-count.c index 01e4e301..6058f7c9 100644 --- a/notmuch-count.c +++ b/notmuch-count.c @@ -150,10 +150,8 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]) }; opt_index = parse_arguments (argc, argv, options, 1); - - if (opt_index < 0) { - return 1; - } + if (opt_index < 0) + return EXIT_FAILURE; if (input_file_name) { batch = TRUE; @@ -161,23 +159,23 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]) if (input == NULL) { fprintf (stderr, "Error opening %s for reading: %s\n", input_file_name, strerror (errno)); - return 1; + return EXIT_FAILURE; } } if (batch && opt_index != argc) { fprintf (stderr, "--batch and query string are not compatible\n"); - return 1; + return EXIT_FAILURE; } if (notmuch_database_open (notmuch_config_get_database_path (config), NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) - return 1; + return EXIT_FAILURE; query_str = query_string_from_args (config, argc-opt_index, argv+opt_index); if (query_str == NULL) { fprintf (stderr, "Out of memory.\n"); - return 1; + return EXIT_FAILURE; } if (exclude == EXCLUDE_TRUE) { @@ -197,5 +195,5 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]) if (input != stdin) fclose (input); - return ret; + return ret ? EXIT_FAILURE : EXIT_SUCCESS; }