SDL: Close pipe in Wayland_ShowMessageBox

From cac143429509d9cd0da0b7eae3159934f324a586 Mon Sep 17 00:00:00 2001
From: Mathieu Eyraud <[EMAIL REDACTED]>
Date: Wed, 17 Apr 2024 21:09:47 +0200
Subject: [PATCH] Close pipe in Wayland_ShowMessageBox

When closing message box by pressing escape, Zenity does not write to the pipe and fgets() get stuck waiting for EOF.
---
 src/video/wayland/SDL_waylandmessagebox.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/video/wayland/SDL_waylandmessagebox.c b/src/video/wayland/SDL_waylandmessagebox.c
index 03ff969c44447..2a8540d0695a0 100644
--- a/src/video/wayland/SDL_waylandmessagebox.c
+++ b/src/video/wayland/SDL_waylandmessagebox.c
@@ -212,6 +212,7 @@ int Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *button
         FILE *outputfp = NULL;
         char *output = NULL;
         char *tmp = NULL;
+        close(fd_pipe[1]);
 
         if (!buttonID) {
             /* if we don't need buttonID, we can return immediately */