[gaim-migrate @ 15848]

Thu, 09 Mar 2006 01:48:00 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Thu, 09 Mar 2006 01:48:00 +0000
changeset 13473
8fe2387d215b
parent 13472
21ebfc7d1430
child 13474
c3823279a88f

[gaim-migrate @ 15848]
Use g_mkstemp() to create the temp file instead. This should work. I promise I'll test this in a minute when I'm done in the other tree.

src/log.c file | annotate | diff | comparison | revisions
--- a/src/log.c	Thu Mar 09 01:17:33 2006 +0000
+++ b/src/log.c	Thu Mar 09 01:48:00 2006 +0000
@@ -1305,8 +1305,6 @@
 	time_t log_last_modified;
 	FILE *index;
 	FILE *file;
-	GError *error;
-	char *index_template;
 	int index_fd;
 	char *index_tmp;
 	char buf[BUF_LONG];
@@ -1387,12 +1385,12 @@
 		return NULL;
 	}
 
-	index_template = g_strdup_printf("%s.XXXXXX", pathstr);
-	if ((index_fd = g_file_open_tmp(index_template, &index_tmp, &error)) == -1) {
+	index_tmp = g_strdup_printf("%s.XXXXXX", pathstr);
+	if ((index_fd = g_mkstemp(index_tmp)) == -1) {
 		gaim_debug_error("log", "Failed to open index temp file: %s\n",
-		                 error->message);
-		g_error_free(error);
+		                 strerror(errno));
 		g_free(pathstr);
+		g_free(index_tmp);
 		index = NULL;
 	} else {
 		if ((index = fdopen(index_fd, "wb")) == NULL)

mercurial