mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 12:05:50 +00:00
Compile fix
This commit is contained in:
parent
406a2ec3fd
commit
734511f562
@ -36,7 +36,7 @@ std::unique_ptr<IndexedFile> LoadCachedIndex(IndexerConfig* config, const std::s
|
||||
|
||||
optional<std::string> LoadCachedFileContents(IndexerConfig* config, const std::string& filename) {
|
||||
if (!config->enableCacheRead)
|
||||
return nullptr;
|
||||
return nullopt;
|
||||
|
||||
return ReadContent(GetCachedBaseFileName(config->cacheDirectory, filename) + ".txt");
|
||||
}
|
||||
|
@ -187,10 +187,6 @@ int64_t GetLastModificationTime(const std::string& absolute_path) {
|
||||
|
||||
// See http://stackoverflow.com/q/13198627
|
||||
void CopyFileTo(const std::string& dest, const std::string& source) {
|
||||
char buf[4096];
|
||||
ssize_t nread;
|
||||
int saved_errno;
|
||||
|
||||
int fd_from = open(source.c_str(), O_RDONLY);
|
||||
if (fd_from < 0)
|
||||
return;
|
||||
@ -199,6 +195,8 @@ void CopyFileTo(const std::string& dest, const std::string& source) {
|
||||
if (fd_to < 0)
|
||||
goto out_error;
|
||||
|
||||
char buf[4096];
|
||||
ssize_t nread;
|
||||
while (nread = read(fd_from, buf, sizeof buf), nread > 0) {
|
||||
char *out_ptr = buf;
|
||||
ssize_t nwritten;
|
||||
|
Loading…
Reference in New Issue
Block a user