]> git.lyx.org Git - features.git/commitdiff
* AutoSaveBuffer::generateChild(): FileName::moveTo() already tries to remove the...
authorAbdelrazak Younes <younes@lyx.org>
Mon, 14 Jan 2008 09:00:32 +0000 (09:00 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 14 Jan 2008 09:00:32 +0000 (09:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22545 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 2c44c7f3c3e415529b220b461fe17418e914823a..6e178c35c2ad65454ab4aaf22d2699b363089b26 100644 (file)
 #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;
 }