]> git.ipfire.org Git - pakfire.git/commitdiff
job: Don't lose build status when closing the log file
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Jan 2025 10:22:49 +0000 (10:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Jan 2025 10:22:49 +0000 (10:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/job.c

index b280232e6cb646e35f4c9865a792bf596e1037ca..1b75d4eb4616ef219342dba0ec2880c4d36c9cac 100644 (file)
@@ -620,6 +620,7 @@ 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
@@ -683,7 +684,7 @@ static int pakfire_job_child(struct pakfire_job* job) {
        }
 
        // Run the build
-       r = pakfire_build_exec(build, job->pkg, pakfire_job_result, job);
+       status = pakfire_build_exec(build, job->pkg, pakfire_job_result, job);
 
        // Close the log file
        r = pakfire_log_file_close(job->log.file);
@@ -693,7 +694,7 @@ static int pakfire_job_child(struct pakfire_job* job) {
        }
 
        // Signal that the job has finished
-       r = pakfire_job_finished(job, r);
+       r = pakfire_job_finished(job, status);
        if (r < 0)
                goto ERROR;