From 93aa95d8c48ec7911388d7675ed2caf8f11e1d1a Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 3 Nov 2018 19:28:16 -0700 Subject: [PATCH] Remove proc_last_bg_pid It wasn't used. --- src/exec.cpp | 3 +-- src/proc.cpp | 1 - src/proc.h | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/exec.cpp b/src/exec.cpp index cb86c56e4..5f981889b 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -1101,8 +1101,7 @@ void exec_job(parser_t &parser, shared_ptr j) { j->set_flag(job_flag_t::CONSTRUCTED, true); if (!j->is_foreground()) { - proc_last_bg_pid = j->pgid; - env_set(L"last_pid", ENV_GLOBAL, { to_string(proc_last_bg_pid) }); + env_set_one(L"last_pid", ENV_GLOBAL, to_string(j->pgid)); } if (job_pushed) { diff --git a/src/proc.cpp b/src/proc.cpp index 9fb4564ec..1bc4f266c 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -83,7 +83,6 @@ bool is_block = false; bool is_breakpoint = false; bool is_login = false; int is_event = false; -pid_t proc_last_bg_pid = 0; int job_control_mode = JOB_CONTROL_INTERACTIVE; int no_exec = 0; diff --git a/src/proc.h b/src/proc.h index 6612b2bab..81abc69d2 100644 --- a/src/proc.h +++ b/src/proc.h @@ -327,9 +327,6 @@ class job_iterator_t { bool get_proc_had_barrier(); void set_proc_had_barrier(bool flag); -/// Pid of last process started in the background. -extern pid_t proc_last_bg_pid; - /// The current job control mode. /// /// Must be one of JOB_CONTROL_ALL, JOB_CONTROL_INTERACTIVE and JOB_CONTROL_NONE.