On 09.08.2025 08:46, Michael Tokarev wrote:
Commit 3736506e25ac7bb "meson: Fix brlapi compile test for
Windows builds" fixed brlapi configure-time test to use
BRLAPI_INVALID_FILE_DESCRIPTOR instead of -1, b/c on windows,
it is not -1.  But the same test is used at run time when
initing brlapi in chardev/baum.c.  Fix this one too.

This patch need "a bit" more work.  Because brlapi_fd is an int
instead of brlapi_fileDescriptor, which is trivial to fix too.
But also, this fd is used for qemu_set_fd_handler(), which is
more interesting.

We had a similar situation in slirp a while back.

Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
---
  chardev/baum.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chardev/baum.c b/chardev/baum.c
index f3e8cd27f0..ecbcd2e5c6 100644
--- a/chardev/baum.c
+++ b/chardev/baum.c
@@ -654,7 +654,7 @@ static void baum_chr_open(Chardev *chr,
      baum->brlapi = handle;
baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
-    if (baum->brlapi_fd == -1) {
+    if (baum->brlapi_fd == BRLAPI_INVALID_FILE_DESCRIPTOR) {
          error_setg(errp, "brlapi__openConnection: %s",
                     brlapi_strerror(brlapi_error_location()));
          g_free(handle);


Reply via email to