bug-bash
[Top][All Lists]
Advanced

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

[patch] Re: Job-handling bug in bash-3.0 and bash-2.05b


From: Tim Waugh
Subject: [patch] Re: Job-handling bug in bash-3.0 and bash-2.05b
Date: Thu, 27 Jan 2005 22:38:55 +0000
User-agent: Mutt/1.4.1i

What do you think about this patch?  It seems to fix the problem at
least.

Tim.
*/

--- bash-3.0/jobs.c.wrap        2005-01-27 15:48:45.000000000 +0000
+++ bash-3.0/jobs.c     2005-01-27 18:17:34.078141310 +0000
@@ -759,6 +759,25 @@
   t->command = name;
   the_pipeline = t;
 
+  /* Sanity check */
+  {
+    PROCESS *p;
+    int job;
+    job = find_job (pid, 0);
+    if (job != NO_JOB)
+      {
+       p = jobs[job]->pipe;
+       do
+         {
+           if (p->pid == pid)
+             break;
+           p = p->next;
+         } while (p != jobs[job]->pipe);
+       jobs[job]->flags |= J_NOTIFIED;
+       p->pid = 0; /* avoid confusion with the new process we just forked */
+      }
+  }
+
   if (t->next == 0)
     t->next = t;
   else




reply via email to

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