Skip to content

Commit af8c887

Browse files
committed
Replace stringerrorname_np with strerror_r
1 parent 6c571e5 commit af8c887

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/storage/CompressedMmappedFile.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,10 @@ bool CompressedMmappedFilePrivate::do_unpack(sserialize::CompressedMmappedFilePr
325325

326326
uint8_t * data = (uint8_t*) mmap(nullptr, params.mmap_size, PROT_READ, MAP_SHARED, m_fd, params.mmap_begin);
327327
if (data == MAP_FAILED) {
328-
throw sserialize::IOException("CompressedMmappedFile mmapping chunk failed with " + std::string(strerrorname_np(errno)));
328+
std::string buffer;
329+
buffer.resize(128);
330+
std::string errname(::strerror_r(errno, buffer.data(), buffer.size()));
331+
throw sserialize::IOException("CompressedMmappedFile mmapping chunk failed with " + errname);
329332
}
330333

331334
lzo_uint destLen = chunkSize();

0 commit comments

Comments
 (0)