]> git.ipfire.org Git - pakfire.git/commitdiff
tests: jail: Consume any output of the pipe
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Mar 2025 18:44:50 +0000 (18:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Mar 2025 18:44:50 +0000 (18:44 +0000)
This is just because of the log streamer complaining

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/jail.c

index 2196fbe336f554bb8e8324f5d328df79dc44223c..d10e391225e3fd62a17185159a634643d846b007 100644 (file)
@@ -347,6 +347,11 @@ static ssize_t callback_stdin(struct pakfire_ctx* ctx, void* data, char* buffer,
        return bytes_written;
 }
 
+// Just consume the entire line
+static int callback_stdout(struct pakfire_ctx* ctx, void* data, const char* line, size_t length) {
+       return fwrite(line, 1, length, stdout);
+}
+
 static int test_communicate(const struct test* t) {
        struct pakfire_jail* jail = NULL;
        int r = EXIT_FAILURE;
@@ -363,7 +368,7 @@ static int test_communicate(const struct test* t) {
 
        // Check if the mount actually works
        ASSERT_SUCCESS(pakfire_jail_communicate(jail, argv, NULL, 0,
-               callback_stdin, &lines, NULL, NULL));
+               callback_stdin, &lines, callback_stdout, NULL));
 
        // Success
        r = EXIT_SUCCESS;