We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afd0930 commit 81a6b3bCopy full SHA for 81a6b3b
lib/src/CacheFile.cc
@@ -36,6 +36,8 @@ CacheFile::CacheFile(const std::string &path, bool autoDelete)
36
file_ = nullptr;
37
}
38
#endif
39
+ if (!file_)
40
+ LOG_SYSERR << "CacheFile fopen:";
41
42
43
CacheFile::~CacheFile()
@@ -63,7 +65,10 @@ CacheFile::~CacheFile()
63
65
void CacheFile::append(const char *data, size_t length)
64
66
{
67
if (file_)
- fwrite(data, length, 1, file_);
68
+ {
69
+ if (!fwrite(data, length, 1, file_))
70
+ LOG_SYSERR << "CacheFile append:";
71
+ }
72
73
74
size_t CacheFile::length()
@@ -95,7 +100,7 @@ char *CacheFile::data()
95
100
if (data_ == MAP_FAILED)
96
101
97
102
data_ = nullptr;
98
- LOG_SYSERR << "mmap:";
103
+ LOG_SYSERR << "CacheFile mmap:";
99
104
105
106
return data_;
0 commit comments