pgrep: Return 1 rather than 0 if there are no matches

This matches the behavior of `pgrep` on Linux.
This commit is contained in:
Tim Ledbetter 2023-05-30 17:51:06 +01:00 committed by Andreas Kling
parent cd08870a64
commit 8706c88370
Notes: sideshowbarker 2024-07-18 02:13:10 +09:00

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Aziz Berkay Yesilyurt <abyesilyurt@gmail.com>
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -65,5 +66,5 @@ ErrorOr<int> serenity_main(Main::Arguments args)
if (displayed_at_least_one)
outln();
return 0;
return matches.size() > 0 ? 0 : 1;
}