delete_old_job (pid)
     pid_t pid;
{
  PROCESS *p;
  int job;

  job = find_job (pid, 0, &p);
  if (job != NO_JOB)
    {
#ifdef DEBUG
      itrace ("delete_old_job: found pid %d in job %d with state %d", pid, job, jobs[job]->state);
#endif
      if (JOBSTATE (job) == JDEAD)
	delete_job (job, DEL_NOBGPID);
      else
	{
#ifdef DEBUG
	  internal_warning (_("forked pid %d appears in running job %d"), pid, job+1);
#endif
	  if (p)
	    p->pid = 0;
	}
    }
}
delete_old_job (pid)
     pid_t pid;
{
  PROCESS *p;
  int job;

  job = find_job (pid, 0, &p);
  if (job != NO_JOB)
    {
#ifdef DEBUG
      itrace ("delete_old_job: found pid %d in job %d with state %d", pid, job, jobs[job]->state);
#endif
      if (JOBSTATE (job) == JDEAD)
	delete_job (job, DEL_NOBGPID);
      else
	{
#ifdef DEBUG
	  internal_warning (_("forked pid %d appears in running job %d"), pid, job+1);
#endif
	  if (p)
	    p->pid = 0;
	}
    }
}