🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ray Nickson Thu, 13 Jul 1989 00:01
current job not reset when a job is killed
#310
Author: Ray Nickson
Date: Thu, 13 Jul 1989 00:01
61 lines
1935 bytes
ENVIRONMENT: bash 1.01 or 1.02 on an HP300 running MORE/BSD4.3
(although I believe it applies to any system).

SYMPTOM: try the following:
------------------------
bash$ unset auto_resume
bash$ cat
^Z
[1]+ Stopped       cat
bash$ cat
^Z
[2]+ Stopped       cat
bash$ jobs
[1]- Stopped       cat
[2]+ Stopped       cat
bash$ kill -KILL %2
[2]+ Killed        cat     [ aww, poor pussy :-) ]
bash$ jobs
[1]- Stopped       cat
bash$ fg
No such job
bash$
-----------------------

BUG: the shell's notion of previous and current job is not always reset when
the current or previous job dies.

FIX: save them.  I think the delete_job function is the right place to
do it; I haven't properly checked when cleanup_dead_jobs, but the
following patch to version 1.02's jobs.c appears to work in the above
environment.

-rgn
--
nickson@comp.vuw.ac.nz       ...!uunet!vuwcomp!nickson      + 64 4 721000x8142

--------------------cut here--------------------
*** jobs.c.orig	Thu Jul 13 11:28:39 1989
--- jobs.c	Thu Jul 13 11:31:32 1989
***************
*** 272,279 ****
  {
    register JOB *temp = jobs[index];
  
!   jobs[index] = (JOB *)NULL;
  
    free (temp->wd);
    discard_pipeline (temp->pipe);
    if (temp->deferred)
--- 272,282 ----
  {
    register JOB *temp = jobs[index];
  
!   if (index == current_job || index == previous_job)
!     reset_current ();
  
+   jobs[index] = (JOB *)NULL;
+   
    free (temp->wd);
    discard_pipeline (temp->pipe);
    if (temp->deferred)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads