mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
Use g_remove instead of sys::remove in Session::save_state
git-svn-id: svn://localhost/ardour2/branches/3.0@12871 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b5d1dbf62f
commit
4de4c2aab4
1 changed files with 8 additions and 2 deletions
|
|
@ -813,7 +813,10 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
|
||||||
|
|
||||||
if (!tree.write (tmp_path.to_string())) {
|
if (!tree.write (tmp_path.to_string())) {
|
||||||
error << string_compose (_("state could not be saved to %1"), tmp_path.to_string()) << endmsg;
|
error << string_compose (_("state could not be saved to %1"), tmp_path.to_string()) << endmsg;
|
||||||
sys::remove (tmp_path);
|
if (g_remove (tmp_path.to_string().c_str()) != 0) {
|
||||||
|
error << string_compose(_("Could not remove temporary state file at path \"%1\" (%2)"),
|
||||||
|
tmp_path.to_string(), g_strerror (errno)) << endmsg;
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -821,7 +824,10 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
|
||||||
if (::rename (tmp_path.to_string().c_str(), xml_path.c_str()) != 0) {
|
if (::rename (tmp_path.to_string().c_str(), xml_path.c_str()) != 0) {
|
||||||
error << string_compose (_("could not rename temporary session file %1 to %2"),
|
error << string_compose (_("could not rename temporary session file %1 to %2"),
|
||||||
tmp_path.to_string(), xml_path) << endmsg;
|
tmp_path.to_string(), xml_path) << endmsg;
|
||||||
sys::remove (tmp_path);
|
if (g_remove (tmp_path.to_string().c_str()) != 0) {
|
||||||
|
error << string_compose(_("Could not remove temporary state file at path \"%1\" (%2)"),
|
||||||
|
tmp_path.to_string(), g_strerror (errno)) << endmsg;
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue