Implement vitastor-cli fix

This commit is contained in:
Vitaliy Filippov
2023-05-20 23:19:39 +03:00
parent d55d7d5326
commit 105a405b0a
9 changed files with 383 additions and 32 deletions
-17
View File
@@ -55,23 +55,6 @@ std::string realpath_str(std::string path, bool nofail)
return rp;
}
std::string read_all_fd(int fd)
{
int res_size = 0;
std::string res;
while (1)
{
res.resize(res_size+1024);
int r = read(fd, (char*)res.data()+res_size, res.size()-res_size);
if (r > 0)
res_size += r;
else if (!r || errno != EAGAIN && errno != EINTR)
break;
}
res.resize(res_size);
return res;
}
std::string read_file(std::string file, bool allow_enoent)
{
std::string res;