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