Skip to content

Commit

Permalink
utils: Move TEMP_FAILURE_RETRY reimplementation here
Browse files Browse the repository at this point in the history
This will allow it to be used in more places.

Helps: #657
Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Oct 3, 2024
1 parent 2a55242 commit 654a25d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions bubblewrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@
#define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace */
#endif

#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(expression) \
(__extension__ \
({ long int __result; \
do __result = (long int) (expression); \
while (__result == -1L && errno == EINTR); \
__result; }))
#endif

/* We limit the size of a tmpfs to half the architecture's address space,
* to avoid hitting arbitrary limits in the kernel.
* For example, on at least one x86_64 machine, the actual limit seems to be
Expand Down
9 changes: 9 additions & 0 deletions utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
#define FALSE 0
typedef int bool;

#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(expression) \
(__extension__ \
({ long int __result; \
do __result = (long int) (expression); \
while (__result == -1L && errno == EINTR); \
__result; }))
#endif

#define PIPE_READ_END 0
#define PIPE_WRITE_END 1

Expand Down

0 comments on commit 654a25d

Please sign in to comment.