diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-02-20 22:25:42 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-02-20 22:25:42 +0300 |
commit | 71d41ca6bb3a9d888b39f34a30f994ac1cf88873 (patch) | |
tree | 3a11365b77b332c078440204fb82549d34237a35 /ext/session/mod_files.c | |
parent | 2d50280dd013556e51b6f275ca965fe7b530029b (diff) | |
parent | 1ceec3a053647865493ab417d3ce401b9bc42450 (diff) | |
download | php-71d41ca6bb3a9d888b39f34a30f994ac1cf88873.tar.gz |
Merge branch 'master-5.6' of git://anonscm.debian.org/pkg-php/php
Conflicts:
debian/changelog
debian/patches/series
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); |