summaryrefslogtreecommitdiff
path: root/zen/guid.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-04-18 17:00:42 +0000
committerB Stack <bgstack15@gmail.com>2020-04-18 17:00:42 +0000
commitb4ecf755bad016b0d7fbb277106887f405f6b600 (patch)
tree8cfcea5441be72ad92095a3887ded84d38f9ba11 /zen/guid.h
parentMerge branch '10.22' into 'master' (diff)
parentadd upstream 10.23 (diff)
downloadFreeFileSync-10.23.tar.gz
FreeFileSync-10.23.tar.bz2
FreeFileSync-10.23.zip
Merge branch '10.23' into 'master'10.23
add upstream 10.23 See merge request opensource-tracking/FreeFileSync!20
Diffstat (limited to 'zen/guid.h')
-rw-r--r--zen/guid.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/zen/guid.h b/zen/guid.h
index 88059be8..f4af4880 100644
--- a/zen/guid.h
+++ b/zen/guid.h
@@ -27,7 +27,7 @@ std::string generateGUID() //creates a 16-byte GUID
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25) //getentropy() requires glibc 2.25 (ldd --version) PS: CentOS 7 is on 2.17
if (::getentropy(&guid[0], guid.size()) != 0) //"The maximum permitted value for the length argument is 256"
throw std::runtime_error(std::string(__FILE__) + '[' + numberTo<std::string>(__LINE__) + "] Failed to generate GUID." + "\n\n" +
- utfTo<std::string>(formatSystemError(L"getentropy", errno)));
+ utfTo<std::string>(formatSystemError("getentropy", errno)));
#else
class RandomGeneratorPosix
{
@@ -36,7 +36,7 @@ std::string generateGUID() //creates a 16-byte GUID
{
if (fd_ == -1)
throw std::runtime_error(std::string(__FILE__) + '[' + numberTo<std::string>(__LINE__) + "] Failed to generate GUID." + "\n\n" +
- utfTo<std::string>(formatSystemError(L"open", errno)));
+ utfTo<std::string>(formatSystemError("open", errno)));
}
~RandomGeneratorPosix() { ::close(fd_); }
@@ -48,7 +48,7 @@ std::string generateGUID() //creates a 16-byte GUID
const ssize_t bytesRead = ::read(fd_, static_cast<char*>(buf) + offset, size - offset);
if (bytesRead < 1) //0 means EOF => error in this context (should check for buffer overflow, too?)
throw std::runtime_error(std::string(__FILE__) + '[' + numberTo<std::string>(__LINE__) + "] Failed to generate GUID." + "\n\n" +
- utfTo<std::string>(formatSystemError(L"read", bytesRead < 0 ? errno : EIO)));
+ utfTo<std::string>(formatSystemError("read", bytesRead < 0 ? errno : EIO)));
offset += bytesRead;
assert(offset <= size);
}
bgstack15