diff src/buddyicon.c @ 10589:0f7452b1f777

[gaim-migrate @ 11994] Use GLib 2.6's gstdio functions. This should fix gaim not liking non-ascii filenames in win32. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 11 Feb 2005 05:10:40 +0000
parents f5c9438982f8
children dc59482c8d37
line wrap: on
line diff
--- a/src/buddyicon.c	Fri Feb 11 03:51:26 2005 +0000
+++ b/src/buddyicon.c	Fri Feb 11 05:10:40 2005 +0000
@@ -225,7 +225,7 @@
 	{
 		gaim_debug_info("buddy icons", "Creating icon cache directory.\n");
 
-		if (mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0)
+		if (g_mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0)
 		{
 			gaim_debug_error("buddy icons",
 							 "Unable to create directory %s: %s\n",
@@ -233,7 +233,7 @@
 		}
 	}
 
-	if ((file = fopen(filename, "wb")) != NULL)
+	if ((file = g_fopen(filename, "wb")) != NULL)
 	{
 		fwrite(data, 1, len, file);
 		fclose(file);
@@ -243,12 +243,12 @@
 
 	if (old_icon != NULL)
 	{
-		if(!stat(old_icon, &st))
-			unlink(old_icon);
+		if(!g_stat(old_icon, &st))
+			g_unlink(old_icon);
 		else {
 			filename = g_build_filename(dirname, old_icon, NULL);
-			if(!stat(filename, &st))
-				unlink(filename);
+			if(!g_stat(filename, &st))
+				g_unlink(filename);
 			g_free(filename);
 		}
 	}
@@ -373,13 +373,13 @@
 		if ((file = gaim_blist_node_get_string((GaimBlistNode*)b, "buddy_icon")) == NULL)
 			return NULL;
 
-		if (!stat(file, &st))
+		if (!g_stat(file, &st))
 			filename = g_strdup(file);
 		else
 			filename = g_build_filename(gaim_buddy_icons_get_cache_dir(), file, NULL);
 
-		if (!stat(filename, &st)) {
-			FILE *f = fopen(filename, "rb");
+		if (!g_stat(filename, &st)) {
+			FILE *f = g_fopen(filename, "rb");
 			if (f) {
 				char *data = g_malloc(st.st_size);
 				fread(data, 1, st.st_size, f);