From c904bd6580df2b9df2afa090649095e48054b625 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 3 Jul 2001 22:42:22 +0000 Subject: make sure we seek to the begining. 2001-07-03 Larry Ewing * e-msg-composer.c (autosave_save_draft): make sure we seek to the begining. svn path=/trunk/; revision=10773 --- composer/ChangeLog | 3 +++ composer/e-msg-composer.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 2e3d5cde89..7eb4b14dd7 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,5 +1,8 @@ 2001-07-03 Larry Ewing + * e-msg-composer.c (autosave_save_draft): make sure we seek to the + begining. + * e-msg-composer.h: remove the timer id. * e-msg-composer.c: use autosave manager. diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 9aac0ace6e..160e45127c 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1012,7 +1012,7 @@ autosave_save_draft (EMsgComposer *composer) if (fd == -1) { e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR, - _("Error opening file: %s"), file); + _("Error accessing file: %s"), file); return; } @@ -1024,6 +1024,12 @@ autosave_save_draft (EMsgComposer *composer) return; } + if (lseek (fd, (off_t)0, SEEK_SET) == -1) { + e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR, + _("Unable to seek on file: %s\n%s"), file, strerror(errno)); + return; + } + if (ftruncate (fd, (off_t)0) == -1) { e_notice (GTK_WINDOW (composer), GNOME_MESSAGE_BOX_ERROR, _("Unable to truncate file: %s\n%s"), file, strerror(errno)); -- cgit