Mercurial > pidgin.yaz
diff src/pounce.c @ 10399:aab0c9508318
[gaim-migrate @ 11630]
Don't erase prefs/accounts/blist/pounces if we failed to write the new file
to disk - this fixes the "Gaim lost all my settings when my disk/quota
filled up" bugs.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sun, 19 Dec 2004 17:35:59 +0000 |
parents | 0ad01d743f60 |
children | bed2c96bc1fb |
line wrap: on
line diff
--- a/src/pounce.c Sun Dec 19 12:57:29 2004 +0000 +++ b/src/pounce.c Sun Dec 19 17:35:59 2004 +0000 @@ -846,6 +846,7 @@ gaim_pounces_sync(void) { FILE *fp; + struct stat st; const char *user_dir = gaim_user_dir(); char *filename; char *filename_real; @@ -892,6 +893,13 @@ return; } + if (stat(filename, &st) || (st.st_size == 0)) { + gaim_debug_error("pounces", "Failed to save pounces\n"); + unlink(filename); + g_free(filename); + return; + } + filename_real = g_build_filename(user_dir, "pounces.xml", NULL); if (rename(filename, filename_real) < 0) {