summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2007-09-04 04:48:39 +0000
committerTim Mayberry <mojofunk@gmail.com>2007-09-04 04:48:39 +0000
commit05b4d05d12a36d643631a4816ff0c7c233f3f7e8 (patch)
tree22b0ebf3ccb8cf461810d904ad8caed5f31d9415 /libs
parentdd51b6a6b8bc4128c94624b078237bc30d360583 (diff)
Use ARDOUR::create_backup_file in Session::save_state
git-svn-id: svn://localhost/ardour2/trunk@2384 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_state.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 758c2b609a..a169c32f64 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -564,7 +564,6 @@ Session::save_state (string snapshot_name, bool pending)
{
XMLTree tree;
sys::path xml_path(_session_dir->root_path());
- sys::path bak_path(xml_path);
if (_state_of_the_state & CannotSave) {
return 1;
@@ -594,20 +593,10 @@ Session::save_state (string snapshot_name, bool pending)
xml_path /= snapshot_name + statefile_suffix;
/* make a backup copy of the old file */
- bak_path /= snapshot_name + statefile_suffix + backup_suffix;
-
- if (sys::exists (xml_path)) {
- try
- {
- sys::copy_file (xml_path, bak_path);
- }
- catch(sys::filesystem_error& ex)
- {
- error << string_compose (_("Unable to make backup of state file %1 (%2)"),
- xml_path.to_string(), ex.what())
- << endmsg;
- return -1;
- }
+
+ if (sys::exists(xml_path) && !create_backup_file (xml_path)) {
+ // create_backup_file will log the error
+ return -1;
}
} else {