]> git.ipfire.org Git - pakfire.git/commitdiff
compress: Add AGAIN return code to restart walking through an archive
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Oct 2023 14:53:57 +0000 (14:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Oct 2023 14:53:57 +0000 (14:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/compress.c
src/libpakfire/include/pakfire/compress.h

index 5a2ecf6f54ddc1ba09b7820e24f3c3cb199f62c8..2aae82d7c39abf15ff3a06d688b96d59d59ddd15 100644 (file)
@@ -578,6 +578,10 @@ int pakfire_walk(struct pakfire* pakfire, struct archive* archive,
                                        filter_callback = NULL;
                                        break;
 
+                               case PAKFIRE_WALK_AGAIN:
+                                       DEBUG(pakfire, "Filter callback sent AGAIN\n");
+                                       return -EAGAIN;
+
                                // Raise any other errors
                                default:
                                        DEBUG(pakfire, "Filter callback returned an error: %d\n", r);
index 6bd942b0b1c868697586cdb4d3d6fd538a6229dd..3c509d95d3b0cc3f38f586a2967b8113029c0e0c 100644 (file)
@@ -55,6 +55,9 @@ enum pakfire_walk_codes {
 
        // Like PAKFIRE_WALK_OK, but the callback will not be called again
        PAKFIRE_WALK_DONE  = -30,
+
+       // Start again from the beginning
+       PAKFIRE_WALK_AGAIN = -40,
 };
 
 int pakfire_walk(struct pakfire* pakfire, struct archive* archive,