0001-core-Support-closefrom-also-for-glibc.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001
  2. From: Jiri Kucera <sanczes@gmail.com>
  3. Date: Sun, 25 Jul 2021 11:35:54 +0200
  4. Subject: [PATCH] core: Support closefrom also for glibc.
  5. * src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom.
  6. --
  7. Since 2.34, glibc introduces closefrom (the implementation
  8. follows *BSD standard).
  9. Signed-off-by: Werner Koch <wk@gnupg.org>
  10. [Retrieved from:
  11. https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commit;h=4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e]
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. ---
  14. src/posix-io.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/src/posix-io.c b/src/posix-io.c
  17. index e712ef28..2a3a81fc 100644
  18. --- a/src/posix-io.c
  19. +++ b/src/posix-io.c
  20. @@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
  21. if (fd_list[i].fd > fd)
  22. fd = fd_list[i].fd;
  23. fd++;
  24. -#if defined(__sun) || defined(__FreeBSD__)
  25. +#if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__)
  26. closefrom (fd);
  27. max_fds = fd;
  28. #else /*!__sun */
  29. --
  30. 2.11.0