summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch')
-rw-r--r--meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch73
1 files changed, 0 insertions, 73 deletions
diff --git a/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch b/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch
deleted file mode 100644
index c1a7d4f40f..0000000000
--- a/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-convert-time_t-to-long.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 9048939b76b3bd10783adb79ed0aaf6cd13895cc Mon Sep 17 00:00:00 2001
-From: Christopher Larson <chris_larson@mentor.com>
-Date: Tue, 13 Dec 2016 20:39:51 -0700
-Subject: [PATCH 1/2] gnome-desktop-thumbnail: don't convert time_t to long
-
-Explicitly use strftime+strptime rather than snprintf+atol. This fixes the
-build for X32, where long's size doesn't match that of time_t.
-
-Upstream-Status: Pending
-Signed-off-by: Christopher Larson <chris_larson@mentor.com>
-
----
- libgnome-desktop/gnome-desktop-thumbnail.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
-index e56c3d7..5d96bf3 100644
---- a/libgnome-desktop/gnome-desktop-thumbnail.c
-+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
-@@ -120,6 +120,8 @@
- * Since: 2.2
- */
-
-+#define _XOPEN_SOURCE
-+
- #include <config.h>
-
- #include <glib.h>
-@@ -1105,6 +1107,7 @@ save_thumbnail (GdkPixbuf *pixbuf,
- char *tmp_path = NULL;
- int tmp_fd;
- char mtime_str[21];
-+ struct tm *tmp_mtime = NULL;
- gboolean ret = FALSE;
- GError *error = NULL;
- const char *width, *height;
-@@ -1124,7 +1127,11 @@ save_thumbnail (GdkPixbuf *pixbuf,
- goto out;
- close (tmp_fd);
-
-- g_snprintf (mtime_str, 21, "%" G_GINT64_FORMAT, (gint64) mtime);
-+ tmp_mtime = localtime (&mtime);
-+ if (!tmp_mtime)
-+ goto out;
-+ strftime (mtime_str, 21, "%s", tmp_mtime);
-+ free (tmp_mtime);
- width = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Width");
- height = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Image::Height");
-
-@@ -1319,6 +1326,7 @@ gnome_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf,
- {
- const char *thumb_uri, *thumb_mtime_str;
- time_t thumb_mtime;
-+ struct tm tmp_mtime;
-
- thumb_uri = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::URI");
- if (g_strcmp0 (uri, thumb_uri) != 0)
-@@ -1327,7 +1335,11 @@ gnome_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf,
- thumb_mtime_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::MTime");
- if (!thumb_mtime_str)
- return FALSE;
-- thumb_mtime = atol (thumb_mtime_str);
-+ if (!strptime (thumb_mtime_str, "%s", &tmp_mtime))
-+ return FALSE;
-+ thumb_mtime = mktime (&tmp_mtime);
-+ if (!thumb_mtime)
-+ return FALSE;
- if (mtime != thumb_mtime)
- return FALSE;
-
---
-2.14.1
-