diff --git a/src/libOpenImageIO/imagebuf.cpp b/src/libOpenImageIO/imagebuf.cpp index b71b817832..550e5d7254 100644 --- a/src/libOpenImageIO/imagebuf.cpp +++ b/src/libOpenImageIO/imagebuf.cpp @@ -677,7 +677,7 @@ ImageBufImpl::error(string_view message) const // a single newline. if (m_err.size() && m_err.back() != '\n') m_err += '\n'; - m_err += message; + m_err += std::string(message); } diff --git a/src/libOpenImageIO/imageinput.cpp b/src/libOpenImageIO/imageinput.cpp index fe53500ab7..6d16f7978b 100644 --- a/src/libOpenImageIO/imageinput.cpp +++ b/src/libOpenImageIO/imageinput.cpp @@ -1072,7 +1072,7 @@ ImageInput::append_error(string_view message) const if (errptr->size() < 1024 * 1024 * 16) { if (errptr->size() && errptr->back() != '\n') *errptr += '\n'; - *errptr += message; + *errptr += std::string(message); } } diff --git a/src/libOpenImageIO/imageio.cpp b/src/libOpenImageIO/imageio.cpp index 97c3408c66..a03ab107bd 100644 --- a/src/libOpenImageIO/imageio.cpp +++ b/src/libOpenImageIO/imageio.cpp @@ -233,12 +233,12 @@ pvt::append_error(string_view message) // a single newline. if (error_msg.size() && error_msg.back() != '\n') error_msg += '\n'; - error_msg += message; + error_msg += std::string(message); // Remove a single trailing newline if (message.size() && message.back() == '\n') message.remove_suffix(1); - error_msg = message; + error_msg = std::string(message); } diff --git a/src/libOpenImageIO/imageoutput.cpp b/src/libOpenImageIO/imageoutput.cpp index 378302bfbd..4a1320df97 100644 --- a/src/libOpenImageIO/imageoutput.cpp +++ b/src/libOpenImageIO/imageoutput.cpp @@ -271,7 +271,7 @@ ImageOutput::append_error(string_view message) const && "Accumulated error messages > 16MB. Try checking return codes!"); if (errptr->size() && errptr->back() != '\n') *errptr += '\n'; - *errptr += message; + *errptr += std::string(message); } diff --git a/src/libtexture/imagecache.cpp b/src/libtexture/imagecache.cpp index 6d42e1e6ad..0635b9545a 100644 --- a/src/libtexture/imagecache.cpp +++ b/src/libtexture/imagecache.cpp @@ -3942,7 +3942,7 @@ ImageCacheImpl::append_error(string_view message) const && "Accumulated error messages > 16MB. Try checking return codes!"); if (errptr->size() && errptr->back() != '\n') *errptr += '\n'; - *errptr += message; + *errptr += std::string(message); } diff --git a/src/libtexture/texturesys.cpp b/src/libtexture/texturesys.cpp index 7c604791ef..619146d155 100644 --- a/src/libtexture/texturesys.cpp +++ b/src/libtexture/texturesys.cpp @@ -927,7 +927,7 @@ TextureSystemImpl::append_error(string_view message) const && "Accumulated error messages > 16MB. Try checking return codes!"); if (errptr->size() && errptr->back() != '\n') *errptr += '\n'; - *errptr += message; + *errptr += std::string(message); } diff --git a/src/libutil/filesystem.cpp b/src/libutil/filesystem.cpp index b59de52e8a..fa3ac7dd10 100644 --- a/src/libutil/filesystem.cpp +++ b/src/libutil/filesystem.cpp @@ -35,6 +35,7 @@ # include # include # include +# include #endif #if defined(USE_STD_FILESYSTEM) @@ -778,12 +779,10 @@ Filesystem::last_write_time(string_view path, std::time_t time) noexcept times.modtime = time; _wutime(u8path(path).c_str(), ×); #else - struct timespec times[2]; - times[0].tv_sec = 0; - times[0].tv_nsec = UTIME_OMIT; - times[1].tv_sec = time; - times[1].tv_nsec = 0; - utimensat((int)AT_FDCWD, u8path(path).c_str(), times, AT_SYMLINK_NOFOLLOW); + struct utimbuf times; + times.actime = time; + times.modtime = time; + utime(u8path(path).c_str(), ×); #endif } diff --git a/src/oiiotool/imagerec.cpp b/src/oiiotool/imagerec.cpp index 9975c83e26..eef31b75e4 100644 --- a/src/oiiotool/imagerec.cpp +++ b/src/oiiotool/imagerec.cpp @@ -413,5 +413,5 @@ ImageRec::append_error(string_view message) const && "Accumulated error messages > 16MB. Try checking return codes!"); if (m_err.size() && m_err[m_err.size() - 1] != '\n') m_err += '\n'; - m_err += message; + m_err += std::string(message); }