mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-09 15:24:54 -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 <string.h>
|
||||||
#include <sys/sysmacros.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
|
int
|
||||||
file_exists_at (int dirfd, const char *pathname)
|
file_exists_at (int dirfd, const char *pathname)
|
||||||
{
|
{
|
||||||
@ -120,7 +129,7 @@ cleanup_closep (void *p)
|
|||||||
{
|
{
|
||||||
int *pp = p;
|
int *pp = p;
|
||||||
if (*pp >= 0)
|
if (*pp >= 0)
|
||||||
close (*pp);
|
TEMP_FAILURE_RETRY (close (*pp));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user