]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
jail: Don't open log descriptors are non-blocking
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Aug 2022 13:39:30 +0000 (13:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Aug 2022 13:39:30 +0000 (13:39 +0000)
We want write() to block if the pipe is full and not drop any messages.

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

index ae94e7b9ab7cbb378585ca416b3e530f78cc8225..a48823474ccc3ac014f5e3993c9d51d42dea5fbb 100644 (file)
@@ -1126,14 +1126,14 @@ static int __pakfire_jail_exec(struct pakfire_jail* jail, const char* argv[]) {
        // Create pipes to communicate with child process if we are not running interactively
        if (!pakfire_jail_has_flag(jail, PAKFIRE_JAIL_INTERACTIVE)) {
                // stdout
-               r = pipe2(ctx.pipes.stdout, O_NONBLOCK);
+               r = pipe(ctx.pipes.stdout);
                if (r < 0) {
                        ERROR(jail->pakfire, "Could not create file descriptors for stdout: %m\n");
                        goto ERROR;
                }
 
                // stderr
-               r = pipe2(ctx.pipes.stderr, O_NONBLOCK);
+               r = pipe(ctx.pipes.stderr);
                if (r < 0) {
                        ERROR(jail->pakfire, "Could not create file descriptors for stderr: %m\n");
                        goto ERROR;