Revision 16c3212b26b63bad7dc58808cea236614276d786

nosnilmot at pidgin.im nosnilmot at pidgin.im
Wed Apr 11 01:21:25 EDT 2007


o   -----------------------------------------------------------------
|   Revision: 16c3212b26b63bad7dc58808cea236614276d786
|   Ancestor: 373c1eac572f850e04e67e14cb2d2195a4ef4119
|   Author: nosnilmot
|   Date: 2004-12-19T17:35:30
|   Branch: im.pidgin.gaim.oldstatus
|   
|   Modified files:
|           src/account.c src/blist.c src/pounce.c src/prefs.c
|   
|   ChangeLog: 
|   
|   [gaim-migrate @ 11629]
|   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.
|   ============================================================
|   --- src/account.c	d93c96d7f871cd4fa4d32dcde4ed0345e4e2f1dd
|   +++ src/account.c	595c9cd20ae38261e125cd2e7a4feb4361300ff8
|   @@ -1362,6 +1362,7 @@ gaim_accounts_sync(void)
|    gaim_accounts_sync(void)
|    {
|    	FILE *fp;
|   +	struct stat st;
|    	const char *user_dir = gaim_user_dir();
|    	char *filename;
|    	char *filename_real;
|   @@ -1408,6 +1409,13 @@ gaim_accounts_sync(void)
|    		return;
|    	}
|    
|   +	if (stat(filename, &st) || (st.st_size == 0)) {
|   +		gaim_debug_error("accounts", "Failed to save accounts\n");
|   +		unlink(filename);
|   +		g_free(filename);
|   +		return;
|   +	}
|   +
|    	filename_real = g_build_filename(user_dir, "accounts.xml", NULL);
|    
|    	if (rename(filename, filename_real) < 0) {
|   ============================================================
|   --- src/blist.c	69f30db2faadc2eab058ea806ba3d7df91944723
|   +++ src/blist.c	5a3253cfbd10f8e46b495b0d2acbcc3bf50c9395
|   @@ -2381,6 +2381,7 @@ void gaim_blist_sync()
|    void gaim_blist_sync()
|    {
|    	FILE *file;
|   +	struct stat st;
|    	char *user_dir = gaim_user_dir();
|    	char *filename;
|    	char *filename_real;
|   @@ -2413,13 +2414,19 @@ void gaim_blist_sync()
|    		return;
|    	}
|    
|   +	if (stat(filename, &st) || (st.st_size == 0)) {
|   +		gaim_debug_error("blist", "Failed to save blist\n");
|   +		unlink(filename);
|   +		g_free(filename);
|   +		return;
|   +	}
|   +
|    	filename_real = g_build_filename(user_dir, "blist.xml", NULL);
|    
|    	if (rename(filename, filename_real) < 0)
|    		gaim_debug(GAIM_DEBUG_ERROR, "blist save",
|    				   "Error renaming %s to %s\n", filename, filename_real);
|    
|   -
|    	g_free(filename);
|    	g_free(filename_real);
|    }
|   ============================================================
|   --- src/pounce.c	bdd632438ee239d0dc9f662cc67d58706b006364
|   +++ src/pounce.c	1b3b81a04e294b98212f371af8e4a87084a1ce0e
|   @@ -846,6 +846,7 @@ gaim_pounces_sync(void)
|    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 @@ gaim_pounces_sync(void)
|    		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) {
|   ============================================================
|   --- src/prefs.c	7164965665e8544885d34754b8279ffae35e180e
|   +++ src/prefs.c	62d66b06dce2418f9de56b68f0c766792333ae6c
|   @@ -768,6 +768,7 @@ void gaim_prefs_sync() {
|    
|    void gaim_prefs_sync() {
|    	FILE *file;
|   +	struct stat st;
|    	const char *user_dir = gaim_user_dir();
|    	char *filename;
|    	char *filename_real;
|   @@ -802,6 +803,13 @@ void gaim_prefs_sync() {
|    		return;
|    	}
|    
|   +	if (stat(filename, &st) || (st.st_size == 0)) {
|   +		gaim_debug_error("prefs", "Failed to save prefs\n");
|   +		unlink(filename);
|   +		g_free(filename);
|   +		return;
|   +	}
|   +
|    	filename_real = g_build_filename(user_dir, "prefs.xml", NULL);
|    	if(rename(filename, filename_real) < 0)
|    		gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error renaming %s to %s\n",

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from 16c3212b26b63bad7dc58808cea236614276d786


More information about the Commits mailing list