mirror of
https://github.com/uutils/procps.git
synced 2026-05-06 06:06:43 -04:00
ps: Exit with status 1 if no process matched
For example, `ps --deselect -A` or `ps --pid` for non existing pid trigger this.
This commit is contained in:
@@ -35,6 +35,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
|
||||
let selection_settings = ProcessSelectionSettings::from_matches(&matches);
|
||||
let mut proc_infos = selection_settings.select_processes()?;
|
||||
if proc_infos.is_empty() {
|
||||
uucore::error::set_exit_code(1);
|
||||
}
|
||||
|
||||
sorting::sort(&mut proc_infos, &matches);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user