changeset 13472:660916251ba8

[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. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 09 Mar 2006 01:48:00 +0000
parents 0f3036e073b6
children 38bcc0a2d4da
files src/log.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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)