From fcc4134a7b76d82d39dea635c41ec593a41d6d19 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 22 Feb 2009 19:29:48 +0800 Subject: [JOBS] Do not close stderr when /dev/tty fails to open As it stands if we fail to open /dev/tty we end up closing stderr after saving it at a higher fd. Thanks to David van Gorkom for reporting this. Signed-off-by: Herbert Xu --- ChangeLog | 1 + src/jobs.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index d87e5d4..dcb7182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Fix dowait signal race. * Remove EXSIG. + * Do not close stderr when /dev/tty fails to open. 2009-01-14 Herbert Xu diff --git a/src/jobs.c b/src/jobs.c index 69a84f7..b1ab7ab 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -195,6 +195,9 @@ setjobctl(int on) while (!isatty(fd)) if (--fd < 0) goto out; + fd = dup(fd); + if (fd < 0) + goto out; } fd = savefd(fd); do { /* while we are in the background */ -- cgit 1.4.1 og/bin/catsh/cd.c?follow=1'>log tree commit diff
Commit message (Expand)Author
2019-05-27Break nicks with ZWNJJune McEnroe
2019-05-26Add DawnJune McEnroe
2019-05-20Declare vasprintf(3) for GNUJune McEnroe
2019-05-20Fix comparison warning in ttpreJune McEnroe
2019-05-20Add AuthorityJune McEnroe
2019-05-19Specify precedence of unary versions of operatorsJune McEnroe
2019-05-18Add compound assignment operators to orderJune McEnroe
2019-05-15Support simple assignment in orderJune McEnroe
2019-05-15Implement sizeof in orderJune McEnroe
2019-05-15Add orderJune McEnroe
2019-05-12Add T suffix in bitJune McEnroe
2019-05-10Highlight yacc and lex files as CJune McEnroe
2019-05-10Use val instead of suboptargJune McEnroe
2019-05-09Add Parable of the SowerJune McEnroe
2019-05-07Add bit without buildJune McEnroe
2019-05-04Fix MANDIR typoJune McEnroe
2019-05-04Move relay to binJune McEnroe