From b41a6c6f055e87d87b42bfd87fbad14a23134e4e Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Tue, 3 Feb 2015 14:02:58 +0900 Subject: Fixed Bug #66623 no EINTR check on flock(LOCK_EX) --- ext/session/mod_files.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ext/session/mod_files.c') 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 -- cgit v1.2.1