mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-08 23:07:28 -04:00
utils: retry on temporary close failures
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
d4a957dea9
commit
8a7508ed40
11
utils.c
11
utils.c
@ -23,6 +23,15 @@
|
||||
#include <string.h>
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
#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
|
||||
|
||||
int
|
||||
file_exists_at (int dirfd, const char *pathname)
|
||||
{
|
||||
@ -120,7 +129,7 @@ cleanup_closep (void *p)
|
||||
{
|
||||
int *pp = p;
|
||||
if (*pp >= 0)
|
||||
close (*pp);
|
||||
TEMP_FAILURE_RETRY (close (*pp));
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user