src: more clang-format

This commit is contained in:
Markus F.X.J. Oberhumer
2023-10-05 11:53:02 +02:00
parent 632c7c4826
commit e767461f65
23 changed files with 733 additions and 1191 deletions
+7 -4
View File
@@ -52,18 +52,21 @@
throwIOException("rename error", errno);
}
/*static*/ bool FileBase::unlink(const char *name, bool check) {
assert(name != nullptr && name[0] != 0);
/*static*/ bool FileBase::unlink_noexcept(const char *name) noexcept {
assert_noexcept(name != nullptr && name[0] != 0);
bool success = ::unlink(name) == 0;
#if HAVE_CHMOD
if (!success)
success = (::chmod(name, 0666) == 0 && ::unlink(name) == 0);
#endif
if (check && !success)
throwIOException(name, errno);
return success;
}
/*static*/ void FileBase::unlink(const char *name) {
if (!unlink_noexcept(name))
throwIOException(name, errno);
}
/*************************************************************************
// FileBase
**************************************************************************/