Ignore shm deletion errors.

This commit is contained in:
levlam 2021-09-22 11:33:28 +03:00
parent 191c732245
commit dc6d9822a2

View File

@ -10,6 +10,7 @@
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/port/path.h"
#include "td/utils/port/Stat.h"
@ -24,7 +25,7 @@ Status RawSqliteDb::destroy(Slice path) {
Status error;
with_db_path(path, [&](auto path) {
unlink(path).ignore();
if (!stat(path).is_error()) {
if (!ends_with(path, "-shm") && !stat(path).is_error()) {
error = Status::Error(PSLICE() << "Failed to delete file \"" << path << '"');
}
});