diff options
| author | Jeff Garzik <[email protected]> | 2011-07-12 20:22:38 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2011-07-12 20:22:38 -0700 |
| commit | 4ea952d5c03e18b9ddd0e97f4434cd9092358dab (patch) | |
| tree | f0f627dc9188eb11b02bed39ca66287ccd9634af /src/util.cpp | |
| parent | Update makefile.linux-mingw to work with crypter and UPnP fix. (diff) | |
| parent | fix warning: unused function 'SigIllHandlerSSE2' [-Wunused-function] (diff) | |
| download | discoin-4ea952d5c03e18b9ddd0e97f4434cd9092358dab.tar.xz discoin-4ea952d5c03e18b9ddd0e97f4434cd9092358dab.zip | |
Merge pull request #399 from muggenhor/warning-fixes
Warning fixes
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util.cpp b/src/util.cpp index 479c601ee..7693aaa52 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -760,8 +760,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); @@ -790,7 +790,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); |