pgrep: Return 1 rather than 0 if there are no matches
This matches the behavior of `pgrep` on Linux.
This commit is contained in:
parent
cd08870a64
commit
8706c88370
Notes:
sideshowbarker
2024-07-18 02:13:10 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/8706c88370 Pull-request: https://github.com/SerenityOS/serenity/pull/19155
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue