diff options
author | Larry Ewing <lewing@ximian.com> | 2001-07-04 06:42:22 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2001-07-04 06:42:22 +0800 |
commit | c904bd6580df2b9df2afa090649095e48054b625 (patch) | |
tree | 81bc905dc415b3711c380d7cfa767340d5d4ec43 | |
parent | dd5ad61e1977b67f8790d488b96d58237b095718 (diff) | |
download | gsoc2013-evolution-c904bd6580df2b9df2afa090649095e48054b625.tar.gz gsoc2013-evolution-c904bd6580df2b9df2afa090649095e48054b625.tar.zst gsoc2013-evolution-c904bd6580df2b9df2afa090649095e48054b625.zip |
make sure we seek to the begining.
2001-07-03 Larry Ewing <lewing@ximian.com>
* e-msg-composer.c (autosave_save_draft): make sure we seek to the
begining.
svn path=/trunk/; revision=10773
-rw-r--r-- | composer/ChangeLog | 3 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 8 |
2 files changed, 10 insertions, 1 deletions
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 <lewing@ximian.com> + * 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)); |