aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-07-15 16:08:38 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-07-15 16:42:44 +0200
commitd4211176208b5e4ae4a699c6ce3239447752cdb2 (patch)
tree2f1c91d534d1571e3a04c000d66590964bbc213e /src/util.cpp
parenta24b23622e504f5134dd8011af5bbe68cb9443f1 (diff)
parent5b0fc31b1c3d25039262ae2043474b35c14bd30b (diff)
downloadbitcoin-d4211176208b5e4ae4a699c6ce3239447752cdb2.tar.xz
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 3d89f6a829..7cd92d2e8e 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -758,8 +758,8 @@ string GetPidFile()
void CreatePidFile(string pidFile, pid_t pid)
{
- FILE* file;
- if (file = fopen(pidFile.c_str(), "w"))
+ FILE* file = fopen(pidFile.c_str(), "w");
+ if (file)
{
fprintf(file, "%d\n", pid);
fclose(file);
@@ -788,7 +788,9 @@ void ShrinkDebugFile()
fseek(file, -sizeof(pch), SEEK_END);
int nBytes = fread(pch, 1, sizeof(pch), file);
fclose(file);
- if (file = fopen(strFile.c_str(), "w"))
+
+ file = fopen(strFile.c_str(), "w");
+ if (file)
{
fwrite(pch, 1, nBytes, file);
fclose(file);