From 6c0398654015de53269a2ef32eae3c7b560875dd Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 27 Jun 2009 20:38:23 +0800 Subject: [REDIR] Fix incorrect savefd conversions When I added savefd we may end up closing stderr if that is how we get to the tty. This patch fixes by adding a second argument to indicate what fd should be closed which lets jobs.c get around the problem. Signed-off-by: Herbert Xu --- src/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/input.c') diff --git a/src/input.c b/src/input.c index 27c4fd1..1e198e9 100644 --- a/src/input.c +++ b/src/input.c @@ -410,7 +410,7 @@ setinputfile(const char *fname, int flags) sh_error("Can't open %s", fname); } if (fd < 10) - fd = savefd(fd); + fd = savefd(fd, fd); setinputfd(fd, flags & INPUT_PUSH_FILE); out: INTON; -- cgit 1.4.1