summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2012-06-23 05:08:40 +0000
committerTim Mayberry <mojofunk@gmail.com>2012-06-23 05:08:40 +0000
commit4cd73d8165bcacc093cf299579abc075a534f4d3 (patch)
treed61f0e262f3b9d931e919a237e149e01e5a87a39 /libs/ardour/session_state.cc
parent8c831bef10c4b7acbf7c753dd49a6de407b1eef0 (diff)
Use g_rename instead of PBD::sys::rename in Session::rename_state
git-svn-id: svn://localhost/ardour2/branches/3.0@12874 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index edba65b64a..b2c34e08b8 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -655,17 +655,12 @@ Session::rename_state (string old_name, string new_name)
const string old_xml_filename = legalize_for_path (old_name) + statefile_suffix;
const string new_xml_filename = legalize_for_path (new_name) + statefile_suffix;
- const sys::path old_xml_path(Glib::build_filename (_session_dir->root_path(), old_xml_filename));
- const sys::path new_xml_path(Glib::build_filename (_session_dir->root_path(), new_xml_filename));
+ const std::string old_xml_path(Glib::build_filename (_session_dir->root_path(), old_xml_filename));
+ const std::string new_xml_path(Glib::build_filename (_session_dir->root_path(), new_xml_filename));
- try
- {
- sys::rename (old_xml_path, new_xml_path);
- }
- catch (const sys::filesystem_error& err)
- {
+ if (::g_rename (old_xml_path.c_str(), new_xml_path.c_str()) != 0) {
error << string_compose(_("could not rename snapshot %1 to %2 (%3)"),
- old_name, new_name, err.what()) << endmsg;
+ old_name, new_name, g_strerror(errno)) << endmsg;
}
}