Skip to content

ext/opcache/zend_shared_alloc: minor code cleanup #10590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/opcache/zend_shared_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ zend_smm_shared_globals *smm_shared_globals;
static MUTEX_T zts_lock;
#endif
int lock_file;
static char lockfile_name[MAXPATHLEN];
#endif

static const zend_shared_memory_handler_entry handler_table[] = {
Expand All @@ -80,7 +79,7 @@ static const zend_shared_memory_handler_entry handler_table[] = {
};

#ifndef ZEND_WIN32
void zend_shared_alloc_create_lock(char *lockfile_path)
static void zend_shared_alloc_create_lock(const char *lockfile_path)
{
int val;

Expand All @@ -100,6 +99,7 @@ void zend_shared_alloc_create_lock(char *lockfile_path)
return;
#endif

char lockfile_name[MAXPATHLEN];
snprintf(lockfile_name, sizeof(lockfile_name), "%s/%sXXXXXX", lockfile_path, SEM_FILENAME_PREFIX);
lock_file = mkstemp(lockfile_name);
if (lock_file == -1) {
Expand Down