summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2007-09-04 04:48:06 +0000
committerTim Mayberry <mojofunk@gmail.com>2007-09-04 04:48:06 +0000
commit911e30a73a0665de9bef7daeb8b2640ef5473a27 (patch)
tree19805de9d26d84882a99c98616b920df2c60e577
parent29842063e312e804e748f2160a90ccc35be63311 (diff)
Use sys::remove instead of ::unlink in Session::remove_pending_capture_state for portability
git-svn-id: svn://localhost/ardour2/trunk@2373 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/session_state.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index bdaaa9e153..c043b3b1ba 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -494,11 +494,19 @@ Session::maybe_write_autosave()
void
Session::remove_pending_capture_state ()
{
- sys::path xml_path(_session_dir->root_path());
+ sys::path pending_state_file_path(_session_dir->root_path());
- xml_path /= _current_snapshot_name + pending_suffix;
+ pending_state_file_path /= _current_snapshot_name + pending_suffix;
- unlink (xml_path.to_string().c_str());
+ try
+ {
+ sys::remove (pending_state_file_path);
+ }
+ catch(sys::filesystem_error& ex)
+ {
+ error << string_compose(_("Could remove pending capture state at path \"%1\" (%2)"),
+ pending_state_file_path.to_string(), ex.what()) << endmsg;
+ }
}
/** Rename a state file.