0001-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 5b5675913e2dbe6c5acda935b5814a8991829ec5 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Tue, 8 Nov 2022 13:31:34 -0800
  4. Subject: [PATCH 2/2] test-bus-error: strerror() is assumed to be GNU specific version mark it so
  5. Upstream-Status: Inappropriate [Upstream systemd only supports glibc]
  6. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  7. ---
  8. src/libsystemd/sd-bus/test-bus-error.c | 2 ++
  9. 1 file changed, 2 insertions(+)
  10. --- a/src/libsystemd/sd-bus/test-bus-error.c
  11. +++ b/src/libsystemd/sd-bus/test-bus-error.c
  12. @@ -99,7 +99,9 @@ TEST(error) {
  13. assert_se(!sd_bus_error_is_set(&error));
  14. assert_se(sd_bus_error_set_errno(&error, EBUSY) == -EBUSY);
  15. assert_se(streq(error.name, "System.Error.EBUSY"));
  16. +#ifdef __GLIBC__
  17. assert_se(streq(error.message, STRERROR(EBUSY)));
  18. +#endif
  19. assert_se(sd_bus_error_has_name(&error, "System.Error.EBUSY"));
  20. assert_se(sd_bus_error_get_errno(&error) == EBUSY);
  21. assert_se(sd_bus_error_is_set(&error));
  22. --- a/src/test/test-errno-util.c
  23. +++ b/src/test/test-errno-util.c
  24. @@ -4,7 +4,7 @@
  25. #include "stdio-util.h"
  26. #include "string-util.h"
  27. #include "tests.h"
  28. -
  29. +#ifdef __GLIBC__
  30. TEST(strerror_not_threadsafe) {
  31. /* Just check that strerror really is not thread-safe. */
  32. log_info("strerror(%d) → %s", 200, strerror(200));
  33. @@ -46,5 +46,6 @@ TEST(STRERROR_OR_ELSE) {
  34. log_info("STRERROR_OR_ELSE(EPERM, \"EOF\") → %s", STRERROR_OR_EOF(EPERM));
  35. log_info("STRERROR_OR_ELSE(-EPERM, \"EOF\") → %s", STRERROR_OR_EOF(-EPERM));
  36. }
  37. +#endif /* __GLIBC__ */
  38. DEFINE_TEST_MAIN(LOG_INFO);