]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Check if progress could be started okay
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Oct 2024 15:29:52 +0000 (15:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Oct 2024 15:29:52 +0000 (15:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/repo.c

index d47606a449925cb322f1bf31a6d033d55f5f6c9d..22aa4bab321f46e779e3bad5b4585e36212e005f 100644 (file)
@@ -1591,6 +1591,8 @@ PAKFIRE_EXPORT int pakfire_repo_scan(struct pakfire_repo* repo, int flags) {
 
        // Start progress
        r = pakfire_progress_start(progress, num_files);
+       if (r < 0)
+               goto ERROR;
 
        for (unsigned int i = 0; i < num_files; i++) {
                struct pakfire_file* file = pakfire_filelist_get(filelist, i);
@@ -1622,7 +1624,7 @@ PAKFIRE_EXPORT int pakfire_repo_scan(struct pakfire_repo* repo, int flags) {
 
        // Finish the progress
        r = pakfire_progress_finish(progress);
-       if (r)
+       if (r < 0)
                goto ERROR;
 
        // Success