summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8ef8c46..2db3302 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6528,6 +6528,10 @@ setjobctl(int on)
int ofd;
ofd = fd = open(_PATH_TTY, O_RDWR);
if (fd < 0) {
+ /* BTW, bash will try to open(ttyname(0)) if open("/dev/tty") fails.
+ * That sometimes helps to acquire controlling tty.
+ * Obviously, a workaround for bugs when someone
+ * failed to provide a controlling tty to bash! :) */
fd += 3;
while (!isatty(fd) && --fd >= 0)
;