src/buddyicon.c

changeset 10589
4e10236e06d4
parent 10523
ef52a88a8512
child 10811
6b7ac5a9dd35
--- 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);

mercurial