aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-migrate.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index ea373a045e..3de054e03f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-migrate.c (cp): Don't O_TRUNC the dest file, instead use
+ O_EXCL and don't do anything if the dest file already exists (this
+ way we don't re-migrate an mbox or corrupt any summary/ibex/meta
+ files).
+
2004-01-12 Not Zed <NotZed@Ximian.com>
** See bug 52737.
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 10fc9248cf..b74d55e882 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -304,7 +304,7 @@ cp (const char *src, const char *dest, gboolean show_progress)
if ((fd[0] = open (src, O_RDONLY)) == -1)
return -1;
- if ((fd[1] = open (dest, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) {
+ if ((fd[1] = open (dest, O_WRONLY | O_CREAT | O_EXCL, 0666)) == -1) {
errnosav = errno;
close (fd[0]);
errno = errnosav;