diff options
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r-- | ext/session/mod_files.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 33e177c5d..195104f39 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -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 @@ -218,7 +221,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC) /* NUL terminate it and */ buf[dirname_len + entry_len + 1] = '\0'; - /* check whether its last access was more than maxlifet ago */ + /* check whether its last access was more than maxlifetime ago */ if (VCWD_STAT(buf, &sbuf) == 0 && (now - sbuf.st_mtime) > maxlifetime) { VCWD_UNLINK(buf); |