Blame SOURCES/libgsf-gnome-695907-selinux-use-tmpdir-for-tmpfile.patch
|
|
6f86ec |
--- libgsf-1.14.26/thumbnailer/main.c 2013-03-15 11:52:30.534080736 +0000
|
|
|
6f86ec |
+++ libgsf-1.14.26/thumbnailer/main.c 2013-03-15 12:03:26.380766098 +0000
|
|
|
6f86ec |
@@ -97,14 +97,19 @@
|
|
|
6f86ec |
static void
|
|
|
6f86ec |
write_thumbnail (const char *filename, gconstpointer data, gsize size, int thumb_size)
|
|
|
6f86ec |
{
|
|
|
6f86ec |
+ GError *error = NULL;
|
|
|
6f86ec |
char *tmp_name;
|
|
|
6f86ec |
int fd;
|
|
|
6f86ec |
FILE *file;
|
|
|
6f86ec |
|
|
|
6f86ec |
- tmp_name = g_strdup_printf ("%s.XXXXXX", filename);
|
|
|
6f86ec |
- fd = g_mkstemp (tmp_name);
|
|
|
6f86ec |
- if (fd == -1) {
|
|
|
6f86ec |
- perror ("Could not create temporary file");
|
|
|
6f86ec |
+ fd = g_file_open_tmp("gsf-thumbnailer-XXXXXX", &tmp_name, &error);
|
|
|
6f86ec |
+ if(error) {
|
|
|
6f86ec |
+ if(error->message) {
|
|
|
6f86ec |
+ g_printerr ("error: %s\n", error->message);
|
|
|
6f86ec |
+ } else {
|
|
|
6f86ec |
+ g_printerr ("error: %s\n", "Could not create tmp file");
|
|
|
6f86ec |
+ }
|
|
|
6f86ec |
+ g_error_free(error);
|
|
|
6f86ec |
exit (EXIT_FAILURE);
|
|
|
6f86ec |
}
|
|
|
6f86ec |
|