Skip to content

Commit

Permalink
Fixing race condition in FdEntity::GetStats
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Wulff committed Dec 13, 2017
1 parent 566961c commit cea7d44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fdcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,10 +1001,10 @@ bool FdEntity::OpenAndLoadAll(headers_t* pmeta, size_t* size, bool force_load)

bool FdEntity::GetStats(struct stat& st)
{
AutoLock auto_lock(&fdent_lock);
if(-1 == fd){
return false;
}
AutoLock auto_lock(&fdent_lock);

memset(&st, 0, sizeof(struct stat));
if(-1 == fstat(fd, &st)){
Expand Down

0 comments on commit cea7d44

Please sign in to comment.