13
0

Use g_strerror() instead of ::strerror() in Session::cleanup_sources

The error is generated by a glib function so use the glib version of this
function(it also consistent with usage in the rest the file).
This commit is contained in:
Tim Mayberry 2016-09-14 21:31:31 +10:00
parent 36d1d842df
commit 304b491a29

View File

@ -3307,7 +3307,7 @@ Session::cleanup_sources (CleanupReport& rep)
if (0 == g_stat ((*x).c_str(), &statbuf)) { if (0 == g_stat ((*x).c_str(), &statbuf)) {
if (::g_rename ((*x).c_str(), newpath.c_str()) != 0) { if (::g_rename ((*x).c_str(), newpath.c_str()) != 0) {
error << string_compose (_("cannot rename unused file source from %1 to %2 (%3)"), (*x), newpath, strerror (errno)) << endmsg; error << string_compose (_("cannot rename unused file source from %1 to %2 (%3)"), (*x), newpath, g_strerror (errno)) << endmsg;
continue; continue;
} }
@ -3324,7 +3324,7 @@ Session::cleanup_sources (CleanupReport& rep)
if (Glib::file_test (peakpath.c_str(), Glib::FILE_TEST_EXISTS)) { if (Glib::file_test (peakpath.c_str(), Glib::FILE_TEST_EXISTS)) {
if (::g_unlink (peakpath.c_str()) != 0) { if (::g_unlink (peakpath.c_str()) != 0) {
error << string_compose (_("cannot remove peakfile %1 for %2 (%3)"), error << string_compose (_("cannot remove peakfile %1 for %2 (%3)"),
peakpath, _path, strerror (errno)) peakpath, _path, g_strerror (errno))
<< endmsg; << endmsg;
/* try to back out */ /* try to back out */
::g_rename (newpath.c_str(), _path.c_str()); ::g_rename (newpath.c_str(), _path.c_str());