Add patch for Gnome bug #606874 (mktemp removed in glibc-2.11.90-8)

This commit is contained in:
Milan Crha 2010-01-13 17:35:18 +00:00
parent 6dd9ff6dda
commit 5f222fa4d6
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,50 @@
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;

View File

@ -62,6 +62,9 @@ Patch11: evolution-2.5.4-fix-conduit-dir.patch
# 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 import Microsoft Personal Storage Table
%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@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@redhat.com> - 2.29.4-2.fc13
- Update Scrollkeeper and Icon Cache scriptlets to conform to guidelines.