mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 23:07:43 +00:00
* AutoSaveBuffer::generateChild(): FileName::moveTo() already tries to remove the file if any so no need to do that again.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22545 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
58a0626e80
commit
2c1b8bc472
@ -95,10 +95,6 @@
|
||||
#include "support/types.h"
|
||||
#include "support/FileZipListDir.h"
|
||||
|
||||
#if !defined (HAVE_FORK)
|
||||
# define fork() -1
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
@ -2285,17 +2281,10 @@ int AutoSaveBuffer::generateChild()
|
||||
if (!tmp_ret.empty()) {
|
||||
buffer_.writeFile(tmp_ret);
|
||||
// assume successful write of tmp_ret
|
||||
if (!tmp_ret.moveTo(fname_)) {
|
||||
if (!tmp_ret.moveTo(fname_))
|
||||
failed = true;
|
||||
// most likely couldn't move between
|
||||
// filesystems unless write of tmp_ret
|
||||
// failed so remove tmp file (if it
|
||||
// exists)
|
||||
tmp_ret.removeFile();
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
failed = true;
|
||||
}
|
||||
|
||||
if (failed) {
|
||||
// failed to write/rename tmp_ret so try writing direct
|
||||
@ -2306,9 +2295,8 @@ int AutoSaveBuffer::generateChild()
|
||||
buffer_.message(_("Autosave failed!"));
|
||||
}
|
||||
}
|
||||
if (pid == 0) { // we are the child so...
|
||||
if (pid == 0) // we are the child so...
|
||||
_exit(0);
|
||||
}
|
||||
}
|
||||
return pid;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user