bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 5.2.37: bg(1)ed job then only runs partially


From: Chet Ramey
Subject: Re: 5.2.37: bg(1)ed job then only runs partially
Date: Tue, 22 Oct 2024 09:57:35 -0400
User-agent: Mozilla Thunderbird

On 10/21/24 6:29 PM, Steffen Nurpmeso wrote:
Hello.

So first: this thread must not even start if the answer is "bash
justs sends a signal to the job's entire process group, if the
programs do not properly deal with that it cannot help that".
(ogg123 in particular is known to have signal issues.)
This just in case possible changes brought in possible bugs.

Yes, that's what bash does.

Bash-5.2 checks whether it thinks the job is running first, and only sends
the SIGCONT if it's not. Since you got the "Stopped" message, bash thinks
the job is stopped. The current devel version sends SIGCONT without
checking. That shouldn't make a difference here.

bash-5.2:

  /* If the job is already running, then don't bother jump-starting it. */
  if (already_running == 0)
    {
      jobs[job]->flags |= J_NOTIFIED;
      killpg (jobs[job]->pgrp, SIGCONT);
    }

bash devel:

  /* Change job state to running only if the kill SIGCONT succeeds or if kill
     says the process has terminated so we clean it up later. */
  if (killpg (jobs[job]->pgrp, SIGCONT) >= 0 || errno == ESRCH)
    set_job_running (job);

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]