diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | libsylph/pop.c | 12 |
3 files changed, 17 insertions, 5 deletions
@@ -1,5 +1,10 @@ 2006-09-14 + * libsylph/pop.c: pop3_write_uidl_list(): use PrefFile to protect + uidl file on disk full. + +2006-09-14 + * src/textview.c: textview_write_error(): new. Made error messages display with red color. Show error when writing body failed. diff --git a/ChangeLog.ja b/ChangeLog.ja index b6f908bf..0521f76c 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2006-09-14 + * libsylph/pop.c: pop3_write_uidl_list(): ディスクが一杯のときに + uidl ファイルを保護するために PrefFile を使用。 + +2006-09-14 + * src/textview.c: textview_write_error(): 新規。 エラーメッセージを赤色で表示するようにした。本文の書き込みに失敗 たらエラーを表示するようにした。 diff --git a/libsylph/pop.c b/libsylph/pop.c index 1a5bd7fd..143bb89d 100644 --- a/libsylph/pop.c +++ b/libsylph/pop.c @@ -35,6 +35,7 @@ #include "pop.h" #include "md5.h" +#include "prefs.h" #include "prefs_account.h" #include "utils.h" #include "recv.h" @@ -504,7 +505,7 @@ GHashTable *pop3_get_uidl_table(PrefsAccount *ac_prefs) gint pop3_write_uidl_list(Pop3Session *session) { gchar *path; - FILE *fp; + PrefFile *pfile; Pop3MsgInfo *msg; gint n; gchar *uid; @@ -517,8 +518,7 @@ gint pop3_write_uidl_list(Pop3Session *session) session->ac_prefs->recv_server, "-", uid, NULL); g_free(uid); - if ((fp = g_fopen(path, "wb")) == NULL) { - FILE_OP_ERROR(path, "fopen"); + if ((pfile = prefs_file_open(path)) == NULL) { g_free(path); return -1; } @@ -529,10 +529,12 @@ gint pop3_write_uidl_list(Pop3Session *session) continue; if (session->state == POP3_DONE && msg->deleted) continue; - fprintf(fp, "%s\t%ld\n", msg->uidl, msg->recv_time); + fprintf(pfile->fp, "%s\t%ld\n", msg->uidl, msg->recv_time); } - if (fclose(fp) == EOF) FILE_OP_ERROR(path, "fclose"); + if (prefs_file_close(pfile) < 0) + g_warning("%s: failed to write UIDL list.\n", path); + g_free(path); return 0; |