From 2c1b8bc472203ccba14ec8b94097d0e2f9c4409c Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 14 Jan 2008 09:00:32 +0000 Subject: [PATCH] * 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 --- src/Buffer.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 2c44c7f3c3..6e178c35c2 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -95,10 +95,6 @@ #include "support/types.h" #include "support/FileZipListDir.h" -#if !defined (HAVE_FORK) -# define fork() -1 -#endif - #include #include @@ -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; }