diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-10 11:23:50 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-10 11:23:50 +0100 |
commit | 5064e5c9a705365524321e01686e73ac1bdf28a0 (patch) | |
tree | ec7977e92148761cb605d27d8ca115f55a256ed2 /synchronizer/main.cpp | |
parent | 9a403ad71d772d776a4bc6f4e7a55d490f6f5c68 (diff) | |
download | sink-5064e5c9a705365524321e01686e73ac1bdf28a0.tar.gz sink-5064e5c9a705365524321e01686e73ac1bdf28a0.zip |
Make sure the path is existing, otherwise the lockfile will not be
created.
Diffstat (limited to 'synchronizer/main.cpp')
-rw-r--r-- | synchronizer/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index afc3c26..7b9165e 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <QCoreApplication> | 20 | #include <QCoreApplication> |
21 | #include <QLockFile> | 21 | #include <QLockFile> |
22 | #include <QDir> | ||
22 | 23 | ||
23 | #include <signal.h> | 24 | #include <signal.h> |
24 | #include <execinfo.h> | 25 | #include <execinfo.h> |
@@ -164,6 +165,7 @@ int main(int argc, char *argv[]) | |||
164 | Sink::Log::setPrimaryComponent(instanceIdentifier); | 165 | Sink::Log::setPrimaryComponent(instanceIdentifier); |
165 | SinkLog() << "Starting: " << instanceIdentifier << resourceType; | 166 | SinkLog() << "Starting: " << instanceIdentifier << resourceType; |
166 | 167 | ||
168 | QDir{}.mkpath(Sink::resourceStorageLocation(instanceIdentifier)); | ||
167 | QLockFile lockfile(Sink::resourceStorageLocation(instanceIdentifier) + "/resource.lock"); | 169 | QLockFile lockfile(Sink::resourceStorageLocation(instanceIdentifier) + "/resource.lock"); |
168 | lockfile.setStaleLockTime(500); | 170 | lockfile.setStaleLockTime(500); |
169 | if (!lockfile.tryLock(0)) { | 171 | if (!lockfile.tryLock(0)) { |