Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
4c558e85
Commit
4c558e85
authored
3 years ago
by
Ansariel
Browse files
Options
Downloads
Patches
Plain Diff
Fix more crashes in disk cache due to boost error handling
parent
ad9ed0a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llfilesystem/lldiskcache.cpp
+20
-4
20 additions, 4 deletions
indra/llfilesystem/lldiskcache.cpp
with
20 additions
and
4 deletions
indra/llfilesystem/lldiskcache.cpp
+
20
−
4
View file @
4c558e85
...
...
@@ -253,9 +253,15 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
// current time
const
std
::
time_t
cur_time
=
std
::
time
(
nullptr
);
boost
::
system
::
error_code
ec
;
#if LL_WINDOWS
// file last write time
const
std
::
time_t
last_write_time
=
boost
::
filesystem
::
last_write_time
(
utf8str_to_utf16str
(
file_path
));
const
std
::
time_t
last_write_time
=
boost
::
filesystem
::
last_write_time
(
utf8str_to_utf16str
(
file_path
),
ec
);
if
(
ec
.
failed
())
{
LL_WARNS
()
<<
"Failed to read last write time for cache file "
<<
file_path
<<
": "
<<
ec
.
message
()
<<
LL_ENDL
;
return
;
}
// delta between cur time and last time the file was written
const
std
::
time_t
delta_time
=
cur_time
-
last_write_time
;
...
...
@@ -264,11 +270,16 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
// before the last one
if
(
delta_time
>
time_threshold
)
{
boost
::
filesystem
::
last_write_time
(
utf8str_to_utf16str
(
file_path
),
cur_time
);
boost
::
filesystem
::
last_write_time
(
utf8str_to_utf16str
(
file_path
),
cur_time
,
ec
);
}
#else
// file last write time
const
std
::
time_t
last_write_time
=
boost
::
filesystem
::
last_write_time
(
file_path
);
const
std
::
time_t
last_write_time
=
boost
::
filesystem
::
last_write_time
(
file_path
,
ec
);
if
(
ec
.
failed
())
{
LL_WARNS
()
<<
"Failed to read last write time for cache file "
<<
file_path
<<
": "
<<
ec
.
message
()
<<
LL_ENDL
;
return
;
}
// delta between cur time and last time the file was written
const
std
::
time_t
delta_time
=
cur_time
-
last_write_time
;
...
...
@@ -277,9 +288,14 @@ void LLDiskCache::updateFileAccessTime(const std::string file_path)
// before the last one
if
(
delta_time
>
time_threshold
)
{
boost
::
filesystem
::
last_write_time
(
file_path
,
cur_time
);
boost
::
filesystem
::
last_write_time
(
file_path
,
cur_time
,
ec
);
}
#endif
if
(
ec
.
failed
())
{
LL_WARNS
()
<<
"Failed to update last write time for cache file "
<<
file_path
<<
": "
<<
ec
.
message
()
<<
LL_ENDL
;
}
}
const
std
::
string
LLDiskCache
::
getCacheInfo
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment