Log a warning when opcache lock file permissions could not be changed

Closes GH-18742.
This commit is contained in:
Taavi Eomäe 2025-06-02 17:37:40 +03:00 committed by Niels Dossche
parent 36891a6775
commit 0a8961a0e2
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 5 additions and 1 deletions

View file

@ -115,7 +115,9 @@ void zend_shared_alloc_create_lock(char *lockfile_path)
zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Unable to create opcache lock file in %s: %s (%d)", lockfile_path, strerror(errno), errno);
}
fchmod(lock_file, 0666);
if (fchmod(lock_file, 0666) == -1) {
zend_accel_error(ACCEL_LOG_WARNING, "Unable to change opcache lock file permissions in %s: %s (%d)", lockfile_path, strerror(errno), errno);
}
val = fcntl(lock_file, F_GETFD, 0);
val |= FD_CLOEXEC;