summaryrefslogtreecommitdiff
path: root/ext/session/mod_files.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r--ext/session/mod_files.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 0ce73bd56c..195104f391 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -121,7 +121,8 @@ static void ps_files_close(ps_files *data)
static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
{
char buf[MAXPATHLEN];
- struct stat sbuf;
+ struct stat sbuf;
+ int ret;
if (data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) {
if (data->lastkey) {
@@ -164,7 +165,9 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
return;
}
#endif
- flock(data->fd, LOCK_EX);
+ do {
+ ret = flock(data->fd, LOCK_EX);
+ } while (ret == -1 && errno == EINTR);
#ifdef F_SETFD
# ifndef FD_CLOEXEC