浏览代码

amended check_redirect

master
10195501441 3 年前
父节点
当前提交
021321f093
共有 3 个文件被更改,包括 2 次插入2 次删除
  1. +0
    -0
      result.txt
  2. 二进制
      yeeshell
  3. +2
    -2
      yeeshell.c

+ 0
- 0
result.txt 查看文件


二进制
yeeshell 查看文件


+ 2
- 2
yeeshell.c 查看文件

@ -204,13 +204,13 @@ int execute(char *cmdline, char **args)
{
fd = open(redirect_filename, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IXUSR);
close(1);
dup2(1, fd);
dup(fd);
}
else if (redirect_flag == 2)
{
fd = open(redirect_filename, O_RDONLY, S_IRUSR);
close(0);
dup2(0, fd);
dup(fd);
}
/* The child process inherits the parent's signal mask and will inherit it after exec,

正在加载...
取消
保存