diff options
-rw-r--r-- | common/storage_lmdb.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index cebd3f0..9789c61 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -607,6 +607,7 @@ DataStore::Private::Private(const QString &s, const QString &n, AccessMode m) : | |||
607 | QDir().mkpath(fullPath); | 607 | QDir().mkpath(fullPath); |
608 | dirInfo.refresh(); | 608 | dirInfo.refresh(); |
609 | } | 609 | } |
610 | Sink::Log::Context logCtx{n.toLatin1()}; | ||
610 | if (mode == ReadWrite && !dirInfo.permission(QFile::WriteOwner)) { | 611 | if (mode == ReadWrite && !dirInfo.permission(QFile::WriteOwner)) { |
611 | qCritical() << fullPath << "does not have write permissions. Aborting"; | 612 | qCritical() << fullPath << "does not have write permissions. Aborting"; |
612 | } else if (dirInfo.exists()) { | 613 | } else if (dirInfo.exists()) { |
@@ -622,7 +623,7 @@ DataStore::Private::Private(const QString &s, const QString &n, AccessMode m) : | |||
622 | int rc = 0; | 623 | int rc = 0; |
623 | if ((rc = mdb_env_create(&env))) { | 624 | if ((rc = mdb_env_create(&env))) { |
624 | // TODO: handle error | 625 | // TODO: handle error |
625 | SinkWarning() << "mdb_env_create: " << rc << " " << mdb_strerror(rc); | 626 | SinkWarningCtx(logCtx) << "mdb_env_create: " << rc << " " << mdb_strerror(rc); |
626 | } else { | 627 | } else { |
627 | mdb_env_set_maxdbs(env, 50); | 628 | mdb_env_set_maxdbs(env, 50); |
628 | unsigned int flags = MDB_NOTLS; | 629 | unsigned int flags = MDB_NOTLS; |
@@ -630,7 +631,7 @@ DataStore::Private::Private(const QString &s, const QString &n, AccessMode m) : | |||
630 | flags |= MDB_RDONLY; | 631 | flags |= MDB_RDONLY; |
631 | } | 632 | } |
632 | if ((rc = mdb_env_open(env, fullPath.toStdString().data(), flags, 0664))) { | 633 | if ((rc = mdb_env_open(env, fullPath.toStdString().data(), flags, 0664))) { |
633 | SinkWarning() << "mdb_env_open: " << rc << " " << mdb_strerror(rc); | 634 | SinkWarningCtx(logCtx) << "mdb_env_open: " << rc << ":" << mdb_strerror(rc); |
634 | mdb_env_close(env); | 635 | mdb_env_close(env); |
635 | env = 0; | 636 | env = 0; |
636 | } else { | 637 | } else { |