rpms/evolution/devel evolution-2.29.5-mktemp.patch,1.1,1.2

Milan Crha mcrha at fedoraproject.org
Wed Jan 13 18:05:23 UTC 2010


Author: mcrha

Update of /cvs/pkgs/rpms/evolution/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15018

Modified Files:
	evolution-2.29.5-mktemp.patch 
Log Message:
forgotten mktemp call in composer code


evolution-2.29.5-mktemp.patch:
 composer/e-composer-autosave.c |    8 ++++++--
 e-util/e-mktemp.c              |   24 +++++++++++++++++++-----
 2 files changed, 25 insertions(+), 7 deletions(-)

Index: evolution-2.29.5-mktemp.patch
===================================================================
RCS file: /cvs/pkgs/rpms/evolution/devel/evolution-2.29.5-mktemp.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- evolution-2.29.5-mktemp.patch	13 Jan 2010 17:35:18 -0000	1.1
+++ evolution-2.29.5-mktemp.patch	13 Jan 2010 18:05:23 -0000	1.2
@@ -1,3 +1,34 @@
+diff --git a/composer/e-composer-autosave.c b/composer/e-composer-autosave.c
+index a289866..f783e6c 100644
+--- a/composer/e-composer-autosave.c
++++ b/composer/e-composer-autosave.c
+@@ -91,6 +91,7 @@ static gboolean
+ composer_autosave_state_open (AutosaveState *state)
+ {
+ 	gchar *path;
++	gint fd;
+ 
+ 	if (state->file != NULL)
+ 		return TRUE;
+@@ -100,13 +101,16 @@ composer_autosave_state_open (AutosaveState *state)
+ 
+ 	/* Since GIO doesn't have support for creating temporary files
+ 	 * from a template (and in a given directory), we have to use
+-	 * mktemp(), which brings a small risk of overwriting another
++	 * g_mkstemp(), which brings a small risk of overwriting another
+ 	 * autosave file.  The risk is, however, miniscule. */
+-	if (mktemp (path) == NULL) {
++	fd = g_mkstemp (path)
++	if (fd == -1) {
+ 		g_free (path);
+ 		return FALSE;
+ 	}
+ 
++	close (fd);
++
+ 	/* Create the GFile */
+ 	state->file = g_file_new_for_path (path);
+ 	g_free (path);
 diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c
 index 509b312..15b5668 100644
 --- a/e-util/e-mktemp.c



More information about the scm-commits mailing list