From ac40f8e1d8ac243915175255ed5ca298a18803b4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 26 Jun 2025 14:30:33 +0000 Subject: [PATCH] job: Call the finished handler in the main process Signed-off-by: Michael Tremer --- src/pakfire/job.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/pakfire/job.c b/src/pakfire/job.c index df3be8ff..d837ad35 100644 --- a/src/pakfire/job.c +++ b/src/pakfire/job.c @@ -377,6 +377,9 @@ static int pakfire_job_finished(struct pakfire_job* job, int status) { if (r < 0) goto ERROR; + // Let the builder know this is finished + r = pakfire_builder_job_finished(job->builder, job); + ERROR: if (xfer) pakfire_xfer_unref(xfer); @@ -491,8 +494,8 @@ static int pakfire_job_exited(sd_event_source* s, const siginfo_t* si, void* dat break; } - // Let the builder know this is finished - return pakfire_builder_job_finished(job->builder, job); + // Signal that the job has finished + return pakfire_job_finished(job, si->si_status); } static int pakfire_job_send_log(struct pakfire_job* job, int priority, const char* line, size_t length) { @@ -594,7 +597,6 @@ static int pakfire_job_child(struct pakfire_job* job) { struct pakfire_ctx* ctx = NULL; struct pakfire_build* build = NULL; int build_flags = 0; - int status; int r; // Fetch our PID @@ -659,12 +661,7 @@ static int pakfire_job_child(struct pakfire_job* job) { } // Run the build - status = pakfire_build_exec(build, job->pkg, pakfire_job_result, job); - - // Signal that the job has finished - r = pakfire_job_finished(job, status); - if (r < 0) - goto ERROR; + r = pakfire_build_exec(build, job->pkg, pakfire_job_result, job); ERROR: if (build) -- 2.47.3