aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-migrate.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-01-17 00:02:43 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-17 00:02:43 +0800
commitc9102b383c917a1dd5ffa202e59ccfe4fe4c3f7d (patch)
tree4084b34e6930c4663b01d0b7e9b744e1577f2635 /mail/em-migrate.c
parent5402231287a5ec4b4a3d7b86b20522732af5e783 (diff)
downloadgsoc2013-evolution-c9102b383c917a1dd5ffa202e59ccfe4fe4c3f7d.tar.gz
gsoc2013-evolution-c9102b383c917a1dd5ffa202e59ccfe4fe4c3f7d.tar.zst
gsoc2013-evolution-c9102b383c917a1dd5ffa202e59ccfe4fe4c3f7d.zip
Oops, still need to stat() the src file so we can report what percentage
2004-01-16 Jeffrey Stedfast <fejj@ximian.com> * em-migrate.c (cp): Oops, still need to stat() the src file so we can report what percentage of the file has been completed so far. svn path=/trunk/; revision=24274
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r--mail/em-migrate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index f7610b7e27..26c3c9c566 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -1248,10 +1248,13 @@ cp (const char *src, const char *dest, gboolean show_progress)
if (stat (dest, &st) == 0 && st.st_size > 0)
return -1;
+ if (stat (src, &st) == -1)
+ return -1;
+
if ((fd[0] = open (src, O_RDONLY)) == -1)
return -1;
- if ((fd[1] = open (dest, O_WRONLY | O_CREAT, 0666)) == -1) {
+ if ((fd[1] = open (dest, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) {
errnosav = errno;
close (fd[0]);
errno = errnosav;