Commit 9cdf2ea1 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Applying InnoDB plugin snashot

Detailed revision comments:

r6048 | vasil | 2009-10-09 08:42:55 +0300 (Fri, 09 Oct 2009) | 16 lines
branches/zip:

When scanning a directory readdir() is called and stat() after it,
if a file is deleted between the two calls stat will fail and the
whole precedure will fail. Change this behavior to continue with the
next entry if stat() fails because of nonexistent file. This is
transparent change as it will make it look as if the file was deleted
before the readdir() call.

This change is needed in order to fix
https://svn.innodb.com/mantis/view.php?id=174
in which we need to abort if os_file_readdir_next_file()
encounters "real" errors.

Approved by:	Marko, Pekka (rb://177)
parent bcb97ed6
......@@ -832,6 +832,23 @@ os_file_readdir_next_file(
ret = stat(full_path, &statinfo);
if (ret) {
if (errno == ENOENT) {
/* readdir() returned a file that does not exist,
it must have been deleted in the meantime. Do what
would have happened if the file was deleted before
readdir() - ignore and go to the next entry.
If this is the last entry then info->name will still
contain the name of the deleted file when this
function returns, but this is not an issue since the
caller shouldn't be looking at info when end of
directory is returned. */
ut_free(full_path);
goto next_file;
}
os_file_handle_error_no_exit(full_path, "stat");
ut_free(full_path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment