1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:07:36 +00:00

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

View file

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