mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd::fs: Improve correctness of fixes; isolate timer. (related 56219f9ea
)
This commit is contained in:
parent
2f51b01008
commit
d434c69755
1 changed files with 12 additions and 11 deletions
23
ircd/fs.cc
23
ircd/fs.cc
|
@ -1986,6 +1986,11 @@ try
|
|||
-1 // sentinel value for inert dtor
|
||||
}
|
||||
{
|
||||
const unwind_exceptional dtor_on_error
|
||||
{
|
||||
[this] { this->~fd(); }
|
||||
};
|
||||
|
||||
const mode_t mode
|
||||
{
|
||||
mode_t(opts.mask)
|
||||
|
@ -2009,13 +2014,15 @@ try
|
|||
0
|
||||
};
|
||||
|
||||
const prof::syscall_usage_warning message
|
||||
{
|
||||
"fs::fs::fd(): openat(2): %s", path
|
||||
};
|
||||
const prof::syscall_usage_warning message
|
||||
{
|
||||
"fs::fs::fd(): openat(2): %s", path
|
||||
};
|
||||
|
||||
assert((flags & ~O_CREAT) || mode != 0);
|
||||
fdno = syscall(::openat, dirfd, path_cstr(path), flags, mode);
|
||||
assert((flags & ~O_CREAT) || mode != 0);
|
||||
fdno = syscall(::openat, dirfd, path_cstr(path), flags, mode);
|
||||
}
|
||||
|
||||
if(advise)
|
||||
fs::advise(*this, advise);
|
||||
|
@ -2032,12 +2039,6 @@ catch(const std::system_error &e)
|
|||
e.what(),
|
||||
};
|
||||
|
||||
this->~fd();
|
||||
throw;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
this->~fd();
|
||||
throw;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue