|
@@ -8,7 +8,6 @@ use core::{
|
|
|
};
|
|
|
|
|
|
use alloc::{
|
|
|
- ffi::CString,
|
|
|
string::{String, ToString},
|
|
|
sync::{Arc, Weak},
|
|
|
vec::Vec,
|
|
@@ -1158,13 +1157,10 @@ impl ProcessControlBlock {
|
|
|
}
|
|
|
|
|
|
/// 生成进程的名字
|
|
|
- pub fn generate_name(program_path: &str, args: &Vec<CString>) -> String {
|
|
|
- let mut name = program_path.to_string();
|
|
|
- for arg in args {
|
|
|
- name.push(' ');
|
|
|
- name.push_str(arg.to_string_lossy().as_ref());
|
|
|
- }
|
|
|
- return name;
|
|
|
+ pub fn generate_name(program_path: &str) -> String {
|
|
|
+ // Extract just the basename from the program path
|
|
|
+ let name = program_path.split('/').last().unwrap_or(program_path);
|
|
|
+ name.to_string()
|
|
|
}
|
|
|
|
|
|
pub fn sig_info_irqsave(&self) -> RwLockReadGuard<ProcessSignalInfo> {
|