git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
64ad448
)
Fix segfault when we're unable to create the lock file.
author
Ricardo M. Correia
<rcorreia@wizy.org>
Fri, 22 Apr 2011 23:26:16 +0000 (
01:26
+0200)
committer
Ricardo M. Correia
<rcorreia@wizy.org>
Fri, 22 Apr 2011 23:40:23 +0000 (
01:40
+0200)
init.cpp
patch
|
blob
|
history
diff --git
a/init.cpp
b/init.cpp
index
8f72181
..
a8e9314
100644
(file)
--- a/
init.cpp
+++ b/
init.cpp
@@
-326,7
+326,7
@@
bool AppInit2(int argc, char* argv[])
// Make sure only a single bitcoin process is using the data directory.
string strLockFile = GetDataDir() + "/.lock";
FILE* file = fopen(strLockFile.c_str(), "a"); // empty lock file; created if it doesn't exist.
- fclose(file);
+ if (file) fclose(file);
static boost::interprocess::file_lock lock(strLockFile.c_str());
if (!lock.try_lock())
{