]> granicus.if.org Git - php/commitdiff
Fixed bug #25070 (Don't forget to unlock session files on win32 before
authorIlia Alshanetsky <iliaa@php.net>
Wed, 24 Sep 2003 23:39:14 +0000 (23:39 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 24 Sep 2003 23:39:14 +0000 (23:39 +0000)
closing them).

Regions should be locked only briefly and should be unlocked before
closing a file or exiting the program. On Win32 locked files that are
closed without being explicitly unlocked will be unlocked only when "system
resources become avaliable".

ext/session/mod_files.c

index 50db773d505dc9194d30ed6f1927b5c54ba1d934..bd5bf660a64a30bd9dbaedb4c536ccf74be786df 100644 (file)
@@ -127,6 +127,7 @@ static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, cons
 static void ps_files_close(ps_files *data)
 {
        if (data->fd != -1) {
+               flock(data->fd, LOCK_UN);
                close(data->fd);
                data->fd = -1;
        }