com php-src: Fixed Bug #66623 no EINTR check on flock(LOCK_ EX): ext/session/mod_files.c
| From: | Yasuo Ohgaki | Date: | Tue, 03 Feb 2015 05:02:58 +0000 |
| Subject: | com php-src: Fixed Bug #66623 no EINTR check on flock(LOCK_ EX): ext/session/mod_files.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84581@lists.php.net to get a copy of this message | ||
Commit: b41a6c6f055e87d87b42bfd87fbad14a23134e4e
Author: Yasuo Ohgaki <yohgaki@php.net> Tue, 3 Feb 2015 14:02:58 +0900
Parents: 853ae39d6ea6a4d2ce95098744e481a1e8573ad8
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b41a6c6f055e87d87b42bfd87fbad14a23134e4e
Log:
Fixed Bug #66623 no EINTR check on flock(LOCK_EX)
Bugs:
https://bugs.php.net/66623
Changed paths:
M ext/session/mod_files.c
Diff:
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 0ce73bd..195104f 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