@ai-ecoverse/slicc-kernel 1.53.3 → 1.53.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10614,9 +10614,11 @@ var JobTable = class {
10614
10614
  const member = this.member(pid);
10615
10615
  const id2 = this.idOf(pid);
10616
10616
  if (member.pgid === id2) throw new KernelError("EPERM");
10617
+ const left = member.pgid;
10617
10618
  member.sid = id2;
10618
10619
  member.pgid = id2;
10619
10620
  this.terminals.delete(id2);
10621
+ this.prune(left);
10620
10622
  return id2;
10621
10623
  }
10622
10624
  terminalNamed(name2) {
@@ -10660,18 +10662,18 @@ var JobTable = class {
10660
10662
  const inSession = [...this.members.values()].some((m) => m.pgid === pgid && m.sid === self.sid);
10661
10663
  if (!inSession) throw new KernelError("EPERM");
10662
10664
  const current = this.foreground.get(tty);
10663
- if (settling && pgid === self.pgid && current !== pgid && this.reclaimed(pgid, self.ppid))
10664
- return;
10665
- if (pgid !== self.pgid) this.handoffs.set(pgid, { by: caller, reclaimed: false });
10665
+ if (settling && pgid === self.pgid && current !== pgid && this.reclaimed(pgid, caller)) return;
10666
+ const by = this.shown(caller);
10667
+ if (pgid !== self.pgid) this.handoffs.set(pgid, { by, reclaimed: false });
10666
10668
  else if (current !== void 0) {
10667
10669
  const handoff = this.handoffs.get(current);
10668
- if (handoff?.by === caller) handoff.reclaimed = true;
10670
+ if (handoff?.by === by) handoff.reclaimed = true;
10669
10671
  }
10670
10672
  this.foreground.set(tty, pgid);
10671
10673
  }
10672
- reclaimed(pgid, parent) {
10674
+ reclaimed(pgid, caller) {
10673
10675
  const handoff = this.handoffs.get(pgid);
10674
- return handoff?.reclaimed === true && handoff.by === parent;
10676
+ return handoff?.reclaimed === true && handoff.by === this.shownParent(caller);
10675
10677
  }
10676
10678
  signalOwnedForeground(tty, sig) {
10677
10679
  const pgid = this.foreground.get(tty);