mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 18:26:48 +00:00
bugfix: 解决shell在exec的时候传递的argv不正确的bug (#437)
This commit is contained in:
parent
709498cac1
commit
4a2d7191a3
@ -1175,15 +1175,14 @@ impl Syscall {
|
||||
Self::get_rusage(who, rusage)
|
||||
}
|
||||
|
||||
SYS_READLINK =>{
|
||||
SYS_READLINK => {
|
||||
let path = args[0] as *const u8;
|
||||
let buf = args[1] as *mut u8;
|
||||
let bufsiz = args[2] as usize;
|
||||
Self::readlink(path, buf, bufsiz)
|
||||
|
||||
}
|
||||
|
||||
SYS_READLINK_AT =>{
|
||||
SYS_READLINK_AT => {
|
||||
let dirfd = args[0] as i32;
|
||||
let pathname = args[1] as *const u8;
|
||||
let buf = args[2] as *mut u8;
|
||||
|
@ -522,9 +522,9 @@ int shell_cmd_exec(int argc, char **argv)
|
||||
// printf("before execv, path=%s, argc=%d\n", file_path, argc);
|
||||
|
||||
char **real_argv;
|
||||
if (argc > 2)
|
||||
if (argc > 1)
|
||||
{
|
||||
real_argv = &argv[2];
|
||||
real_argv = &argv[1];
|
||||
}
|
||||
execv(file_path, real_argv);
|
||||
// printf("after execv, path=%s, argc=%d\n", file_path, argc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user