/pidgin/main: 981ea717afd2: Log an error if g_rename fails when ...

Mark Doliner mark at kingant.net
Sat Dec 29 02:54:48 EST 2012


Changeset: 981ea717afd26ba8f925bed61e3ae3c45c0dd335
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2012-12-28 23:54 -0800
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/981ea717afd2

Description:

Log an error if g_rename fails when installing a theme.

diffstat:

 pidgin/gtkprefs.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (29 lines):

diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -889,7 +889,11 @@ theme_install_theme(char *path, struct t
 						 "purple", info->type, NULL);
 
 			/* move the entire directory to new location */
-			g_rename(purple_theme_get_dir(theme), theme_dest);
+			if (g_rename(purple_theme_get_dir(theme), theme_dest)) {
+				purple_debug_error("gtkprefs", "Error renaming %s to %s: "
+						"%s\n", purple_theme_get_dir(theme), theme_dest,
+						g_strerror(errno));
+			}
 
 			g_free(theme_dest);
 			g_remove(destdir);
@@ -933,7 +937,11 @@ theme_install_theme(char *path, struct t
 				if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR))
 					purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
 
-				g_rename(purple_theme_get_dir(theme), theme_dest);
+				if (g_rename(purple_theme_get_dir(theme), theme_dest)) {
+					purple_debug_error("gtkprefs", "Error renaming %s to %s: "
+							"%s\n", purple_theme_get_dir(theme), theme_dest,
+							g_strerror(errno));
+				}
 
 				g_free(theme_dest);
 				g_object_unref(theme);



More information about the Commits mailing list