OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.9 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/0001-restore-h_errno-ABI-compatibility-with-ancient-binar.patch
  5. # Copyright (C) 2020 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From cf27184d00c1588eccac71a3bc89c9798e60bbd9 Mon Sep 17 00:00:00 2001
  17. From: Rich Felker <dalias@aerifal.cx>
  18. Date: Sun, 30 Aug 2020 21:30:37 -0400
  19. Subject: [PATCH] restore h_errno ABI compatibility with ancient binaries
  20. prior to commit e68c51ac46a9f273927aef8dcebc89912ab19ece, h_errno was
  21. actually an external data object not a macro. bring back the symbol,
  22. and use it as the storage for the main thread's h_errno.
  23. technically this still doesn't provide full compatibility if the
  24. application was multithreaded, but at the time there were no res_*
  25. functions (and they did not set h_errno anyway), so any use of h_errno
  26. would have been via thread-unsafe functions. thus a solution that just
  27. fixes single-threaded applications seems acceptable.
  28. ---
  29. src/network/h_errno.c | 4 ++++
  30. 1 file changed, 4 insertions(+)
  31. diff --git a/src/network/h_errno.c b/src/network/h_errno.c
  32. index 8677a92b..638f7718 100644
  33. --- a/src/network/h_errno.c
  34. +++ b/src/network/h_errno.c
  35. @@ -1,7 +1,11 @@
  36. #include <netdb.h>
  37. #include "pthread_impl.h"
  38. +#undef h_errno
  39. +int h_errno;
  40. +
  41. int *__h_errno_location(void)
  42. {
  43. + if (!__pthread_self()->stack) return &h_errno;
  44. return &__pthread_self()->h_errno_val;
  45. }
  46. --
  47. 2.28.0