mirror of
https://salsa.debian.org/debian/dash.git
synced 2026-01-27 09:54:30 +00:00
redir: Fix double close in dupredirect
For a redirection like "> /dev/null" dupredirect will close the
newly opened file descriptor twice in a row because sh_dup2 also
closes the new file descriptor.
Remove the extra close in dupredirect.
Fixes: 509f5b0dcd71 ("redir: Use memfd_create instead of pipe")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
257f6b36b8
commit
ea5e24281a
@ -319,11 +319,9 @@ static void dupredirect(union node *redir, int f)
|
||||
sh_dup2(f, fd, -1);
|
||||
return;
|
||||
}
|
||||
f = fd;
|
||||
close(fd);
|
||||
} else
|
||||
sh_dup2(f, fd, f);
|
||||
|
||||
close(f);
|
||||
}
|
||||
|
||||
int sh_pipe(int pip[2], int memfd)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user