Skip to content

Commit

Permalink
Ignore shm deletion errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Sep 22, 2021
1 parent 191c732 commit dc6d982
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tddb/td/db/detail/RawSqliteDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 << '"');
}
});
Expand Down

0 comments on commit dc6d982

Please sign in to comment.