aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-01-12 13:00:46 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-12 13:00:46 +0800
commitfad2e1d35daaca3af3d6c9fafb76d0f0fe56c938 (patch)
treec336be4952c9ec2782e11de9c9e55eef857946cd /mail
parent0396b6ca76b4ae9fe4467e14f5cf4963705213ad (diff)
downloadgsoc2013-evolution-fad2e1d35daaca3af3d6c9fafb76d0f0fe56c938.tar.gz
gsoc2013-evolution-fad2e1d35daaca3af3d6c9fafb76d0f0fe56c938.tar.zst
gsoc2013-evolution-fad2e1d35daaca3af3d6c9fafb76d0f0fe56c938.zip
Don't O_TRUNC the dest file, instead use O_EXC and don't do anything if
2004-01-11 Jeffrey Stedfast <fejj@ximian.com> * em-migrate.c (cp): Don't O_TRUNC the dest file, instead use O_EXC 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). svn path=/trunk/; revision=24165
Diffstat (limited to 'mail')
-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;