2ee0faf76fe681c14ab18690a2d852a4065babac — Simon Ser 2 months ago 1e831a5
job_finished → job_terminated
3 files changed, 3 insertions(+), 4 deletions(-)

M include/shell/job.h
M shell/job.c
M shell/task/task.c
M include/shell/job.h => include/shell/job.h +1 -2
@@ 15,14 15,13 @@ struct mrsh_job {
  	pid_t pgid;
  	struct mrsh_state *state;
- 	bool finished;
  	struct mrsh_array processes; // struct process *
  };
  
  struct mrsh_job *job_create(struct mrsh_state *state, pid_t pgid);
  void job_destroy(struct mrsh_job *job);
  void job_add_process(struct mrsh_job *job, struct process *proc);
- bool job_finished(struct mrsh_job *job);
+ bool job_terminated(struct mrsh_job *job);
  
  bool init_job_child_process(struct mrsh_state *state);
  void update_job(struct mrsh_state *state, pid_t pid, int stat);

M shell/job.c => shell/job.c +1 -1
@@ 113,7 113,7 @@ mrsh_array_add(&job->processes, proc);
  }
  
- bool job_finished(struct mrsh_job *job) {
+ bool job_terminated(struct mrsh_job *job) {
  	for (size_t j = 0; j < job->processes.len; ++j) {
  		struct process *proc = job->processes.data[j];
  		if (!proc->terminated) {

M shell/task/task.c => shell/task/task.c +1 -1
@@ 36,7 36,7 @@ static void destroy_finished_jobs(struct mrsh_state *state) {
  	for (ssize_t i = 0; i < (ssize_t)state->jobs.len; ++i) {
  		struct mrsh_job *job = state->jobs.data[i];
- 		if (job_finished(job)) {
+ 		if (job_terminated(job)) {
  			job_destroy(job);
  			--i;
  		}