[elinks-dev] Bug#337159: elinks: Does not recover from CTRL-Z

Kalle Olavi Niemitalo kon at iki.fi
Tue Jan 22 14:26:16 PST 2008

Qingning Huo <qingningh at lanware.co.uk> writes:

> So what is the real reason of this bug, elinks
> is somehow confused whether it is at foreground?

The reason is that "fg" in Bash nowadays does not send SIGCONT to
the job if Bash has seen from waitpid() that the job is already
running.  ELinks expects to receive this SIGCONT, in order to
know when it should try to take control of the terminal again.

This worked correctly in Bash 2.05 but has been broken since 2.05a.
The following patch does not revert any change between 2.05 and 2.05a
but fixes or works around the bug anyway.

diff -up /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c.\~1\~ /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c
--- /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c.~1~	2008-01-23 00:16:33.000000000 +0200
+++ /var/tmp/Kalle/Debian/bash-3.1dfsg/bash/jobs.c	2008-01-23 00:17:55.000000000 +0200
@@ -2754,8 +2754,7 @@ start_job (job, foreground)
     jobs[job]->flags &= ~J_FOREGROUND;
-  /* If the job is already running, then don't bother jump-starting it. */
-  if (already_running == 0)
+  if (1)
       jobs[job]->flags |= J_NOTIFIED;
       killpg (jobs[job]->pgrp, SIGCONT);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-dev/attachments/20080123/aafc705a/attachment.sig>

More information about the elinks-dev mailing list