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:
Tuomas Tynkkynen
2025-11-02 22:19:39 +02:00
parent 0849fe2436
commit 26150ace8d
+3
View File
@@ -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);