office-gobmx/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1
Mike Kaganski f60214a1ad Fix gpgmepp build with glibc
posix-io.c: In function '_gpgme_io_spawn':
posix-io.c:492:23: error: void value not ignored as it ought to be
  492 |             while ((i = closefrom (fd)) && errno == EINTR)
      |                       ^
make[1]: *** [Makefile:964: posix-io.lo] Error 1

Change-Id: I0e7abc33200ca7436c72e925447e681fd241c6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123259
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11 09:07:14 +02:00

32 lines
975 B
Groff

From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001
From: Jiri Kucera <sanczes@gmail.com>
Date: Sun, 25 Jul 2021 11:35:54 +0200
Subject: [PATCH] core: Support closefrom also for glibc.
* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom.
--
Since 2.34, glibc introduces closefrom (the implementation
follows *BSD standard).
Signed-off-by: Werner Koch <wk@gnupg.org>
---
src/posix-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/posix-io.c b/src/posix-io.c
index e712ef28..2a3a81fc 100644
--- a/src/posix-io.c
+++ b/src/posix-io.c
@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
if (fd_list[i].fd > fd)
fd = fd_list[i].fd;
fd++;
-#if defined(__sun) || defined(__FreeBSD__)
+#if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__)
closefrom (fd);
max_fds = fd;
#else /*!__sun */
--
2.11.0