Re: Bug#337159: elinks: Does not recover from CTRL-Z

Kalle Olavi Niemitalo <[email protected]>
Newsgroups gmane.comp.web.links
Message-ID <[email protected]>
Qingning Huo <[email protected]> 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)
   else
     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);

_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev
signature.asc (application/pgp-signature, 188 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHlm2THm9IGt60eMgRApPhAJ9u2Tv54wsM6agMnKekb/1tVhk/pwCdHKMD
lLgA61cZ49M4T8AH4GREk9I=
=dD4f
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.