X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=plocate.cpp;h=7182ee892dfa839b5b50794a4e22582500759996;hb=31641da5750ed2b80697e605bf5b50c0a92264af;hp=28a9c28bfe52065b8425fffdb4ffef661b501865;hpb=19e638d54b74f7593ba607ab53b430385b7ae531;p=plocate diff --git a/plocate.cpp b/plocate.cpp index 28a9c28..7182ee8 100644 --- a/plocate.cpp +++ b/plocate.cpp @@ -571,7 +571,7 @@ uint64_t do_search_file(const vector &needles, const std::string &filena if (only_count) { printf("0\n"); } - exit(0); + exit(1); } } } @@ -972,7 +972,7 @@ int main(int argc, char **argv) } if (needles.empty()) { fprintf(stderr, "plocate: no pattern to search for specified\n"); - exit(0); + exit(1); } if (dbpaths.empty()) { @@ -1000,4 +1000,6 @@ int main(int argc, char **argv) if (only_count) { printf("%" PRId64 "\n", matched); } + + return matched == 0; }