From 138b5cb628f501c3b815bb2b6834aa7815ec67ea Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 12 Oct 2024 16:39:33 +0000 Subject: [PATCH] log stream: Reset file descriptors to EBADF Signed-off-by: Michael Tremer --- src/libpakfire/log_stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libpakfire/log_stream.c b/src/libpakfire/log_stream.c index d212d6f80..cd5f6daf7 100644 --- a/src/libpakfire/log_stream.c +++ b/src/libpakfire/log_stream.c @@ -180,7 +180,7 @@ static int __pakfire_log_stream(sd_event_source* s, int fd, uint32_t events, voi if (stream->pipe[0] >= 0) { close(stream->pipe[0]); - stream->pipe[0] = -1; + stream->pipe[0] = -EBADF; } } @@ -196,7 +196,7 @@ int pakfire_log_stream_in_parent(struct pakfire_log_stream* stream, sd_event* lo // Close the write end of the pipe if (stream->pipe[1] >= 0) { close(stream->pipe[1]); - stream->pipe[1] = -1; + stream->pipe[1] = -EBADF; } // Register the file descriptor with the event loop @@ -217,7 +217,7 @@ int pakfire_log_stream_in_child(struct pakfire_log_stream* stream) { // Close the read end of the pipe if (stream->pipe[0] >= 0) { close(stream->pipe[0]); - stream->pipe[0] = -1; + stream->pipe[0] = -EBADF; } return 0; -- 2.47.3