logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0005-Remove-unnecessary-TEMP_FAILURE_RETRY.patch (2064B)


  1. From cd531eb41821e239f3776295c5a2a4e14bbda2a7 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sun, 2 Feb 2025 01:40:38 -0800
  4. Subject: [PATCH] Remove unnecessary TEMP_FAILURE_RETRY
  5. bwrap doesn't use signal handlers.
  6. ---
  7. bubblewrap.c | 6 +++---
  8. utils.h | 9 ---------
  9. 2 files changed, 3 insertions(+), 12 deletions(-)
  10. diff --git a/bubblewrap.c b/bubblewrap.c
  11. index 4848713..c593436 100644
  12. --- a/bubblewrap.c
  13. +++ b/bubblewrap.c
  14. @@ -479,7 +479,7 @@ report_child_exit_status (int exitc, int setup_finished_fd)
  15. if (opt_json_status_fd == -1 || setup_finished_fd == -1)
  16. return;
  17. - s = TEMP_FAILURE_RETRY (read (setup_finished_fd, data, sizeof data));
  18. + s = read (setup_finished_fd, data, sizeof data);
  19. if (s == -1 && errno != EAGAIN)
  20. die_with_error ("read eventfd");
  21. if (s != 1) // Is 0 if pipe closed before exec, is 2 if closed after exec.
  22. @@ -3207,7 +3207,7 @@ main (int argc,
  23. if (opt_userns_block_fd != -1)
  24. {
  25. char b[1];
  26. - (void) TEMP_FAILURE_RETRY (read (opt_userns_block_fd, b, 1));
  27. + read (opt_userns_block_fd, b, 1);
  28. close (opt_userns_block_fd);
  29. }
  30. @@ -3505,7 +3505,7 @@ main (int argc,
  31. if (opt_block_fd != -1)
  32. {
  33. char b[1];
  34. - (void) TEMP_FAILURE_RETRY (read (opt_block_fd, b, 1));
  35. + read (opt_block_fd, b, 1);
  36. close (opt_block_fd);
  37. }
  38. diff --git a/utils.h b/utils.h
  39. index 079fe7c..bea4e9d 100644
  40. --- a/utils.h
  41. +++ b/utils.h
  42. @@ -43,15 +43,6 @@
  43. #define N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
  44. -#ifndef TEMP_FAILURE_RETRY
  45. -#define TEMP_FAILURE_RETRY(expression) \
  46. - (__extension__ \
  47. - ({ long int __result; \
  48. - do __result = (long int) (expression); \
  49. - while (__result == -1L && errno == EINTR); \
  50. - __result; }))
  51. -#endif
  52. -
  53. #define PIPE_READ_END 0
  54. #define PIPE_WRITE_END 1
  55. --
  56. 2.44.0