rpms/evolution/devel evolution-2.29.5-mktemp.patch, NONE, 1.1 evolution.spec, 1.432, 1.433

Milan Crha mcrha at fedoraproject.org
Wed Jan 13 17:35:18 UTC 2010


Author: mcrha

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

Modified Files:
	evolution.spec 
Added Files:
	evolution-2.29.5-mktemp.patch 
Log Message:
Add patch for Gnome bug #606874 (mktemp removed in glibc-2.11.90-8)


evolution-2.29.5-mktemp.patch:
 e-mktemp.c |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

--- NEW FILE evolution-2.29.5-mktemp.patch ---
diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c
index 509b312..15b5668 100644
--- a/e-util/e-mktemp.c
+++ b/e-util/e-mktemp.c
@@ -167,7 +167,7 @@ gchar *
 e_mktemp (const gchar *template)
 {
 	GString *path;
-	gchar *ret;
+	gint fd;
 
 	path = get_dir (TRUE);
 	if (!path)
@@ -179,10 +179,14 @@ e_mktemp (const gchar *template)
 	else
 		g_string_append (path, "unknown-XXXXXX");
 
-	ret = mktemp (path->str);
-	g_string_free(path, ret == NULL);
+	fd = g_mkstemp (path->str);
 
-	return ret;
+	if (fd != -1) {
+		close (fd);
+		g_unlink (path->str);
+	}
+
+	return g_string_free (path, fd == -1);
 }
 
 gint
@@ -226,7 +230,17 @@ e_mkdtemp (const gchar *template)
 #ifdef HAVE_MKDTEMP
 	tmpdir = mkdtemp (path->str);
 #else
-	tmpdir = mktemp (path->str);
+	{
+		gint fd = g_mkstemp (path->str);
+		if (fd == -1) {
+			tmpdir = NULL;
+		} else {
+			close (fd);
+			tmpdir = path->str;
+			g_unlink (tmpdir);
+		}
+	}
+
 	if (tmpdir) {
 		if (g_mkdir (tmpdir, S_IRWXU) == -1)
 			tmpdir = NULL;


Index: evolution.spec
===================================================================
RCS file: /cvs/pkgs/rpms/evolution/devel/evolution.spec,v
retrieving revision 1.432
retrieving revision 1.433
diff -u -p -r1.432 -r1.433
--- evolution.spec	12 Jan 2010 09:21:58 -0000	1.432
+++ evolution.spec	13 Jan 2010 17:35:18 -0000	1.433
@@ -62,6 +62,9 @@ Patch11: evolution-2.5.4-fix-conduit-dir
 # RH bug #176400
 Patch12: evolution-2.9.1-im-context-reset.patch
 
+# Gnome bug #606874 / RH bug #554643
+Patch13: evolution-2.29.5-mktemp.patch
+
 ## Dependencies ###
 
 Requires(pre): GConf2
@@ -229,6 +232,7 @@ This package contains the plugin to impo
 %patch10 -p1 -b .ldaphack
 %patch11 -p1 -b .fix-conduit-dir
 %patch12 -p1 -b .im-context-reset
+%patch13 -p1 -b .mktemp
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -677,6 +681,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Tue Jan 12 2010 Milan Crha <mcrha at redhat.com> - 2.29.5-1.fc13
 - Update to 2.29.5
+- Add patch for Gnome bug #606874 (mktemp removed in glibc-2.11.90-8)
 
 * Tue Dec 22 2009 Matthew Barnes <mbarnes at redhat.com> - 2.29.4-2.fc13
 - Update Scrollkeeper and Icon Cache scriptlets to conform to guidelines.



More information about the scm-commits mailing list