From: Michael Tremer Date: Sun, 16 Feb 2025 14:54:02 +0000 (+0000) Subject: PTY: Automatically connect stdout/stderr in some cases X-Git-Tag: 0.9.30~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a763bce5b7b6dd65f3e610a880ecf61763f3f704;p=pakfire.git PTY: Automatically connect stdout/stderr in some cases Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/pty.c b/src/pakfire/pty.c index f7ddd854..a343255c 100644 --- a/src/pakfire/pty.c +++ b/src/pakfire/pty.c @@ -1280,6 +1280,9 @@ int pakfire_pty_create(struct pakfire_pty** pty, struct pakfire_ctx* ctx, // Store the flags p->flags = flags; + if (pakfire_pty_has_flag(p, PAKFIRE_PTY_CAPTURE_OUTPUT)) + p->flags |= PAKFIRE_PTY_CONNECT_STDOUT | PAKFIRE_PTY_CONNECT_STDERR; + // Initialize the master file descriptor p->master.fd = -EBADF; @@ -1547,6 +1550,9 @@ void pakfire_pty_set_stdout_callback(struct pakfire_pty* pty, // We are now ready to write pty->stdout.io |= PAKFIRE_PTY_READY_TO_WRITE|PAKFIRE_PTY_MAP_CRNL; + + // Actually connect standard output and error + pty->flags |= PAKFIRE_PTY_CONNECT_STDOUT | PAKFIRE_PTY_CONNECT_STDERR; } ssize_t pakfire_pty_send_buffer(struct pakfire_ctx* ctx,