Skip to content

Propagate errors correctly in ps_files_cleanup_dir() #10644

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 1 commit 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/session/mod_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static int ps_files_cleanup_dir(const char *dirname, zend_long maxlifetime)
dir = opendir(dirname);
if (!dir) {
php_error_docref(NULL, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
return (0);
return -1;
}

time(&now);
Expand All @@ -302,7 +302,7 @@ static int ps_files_cleanup_dir(const char *dirname, zend_long maxlifetime)
if (dirname_len >= MAXPATHLEN) {
php_error_docref(NULL, E_NOTICE, "ps_files_cleanup_dir: dirname(%s) is too long", dirname);
closedir(dir);
return (0);
return -1;
}

/* Prepare buffer (dirname never changes) */
Expand Down