summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Welche <prlw1@cam.ac.uk>2014-09-11 17:06:12 +0200
committerPatrick Welche <prlw1@cam.ac.uk>2014-09-11 17:06:12 +0200
commitb9547595ac9fa2a08318589e060778de03897242 (patch)
tree92b5babffa1da97b1f9b44b85fd23fff7092925e
parent3fc0ffe3b205e0faa0c884c596c38ab5343cc17d (diff)
downloadgnome-desktop-b9547595ac9fa2a08318589e060778de03897242.tar.gz
thumbnail: don't call gs_file_read_noatime() on systems lacking openat()
https://bugzilla.gnome.org/show_bug.cgi?id=735974
-rw-r--r--configure.ac3
-rw-r--r--libgnome-desktop/Makefile.am7
-rw-r--r--libgnome-desktop/gnome-desktop-thumbnail.c4
3 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 489f7f5d..e5514369 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,6 +132,9 @@ AC_SUBST(LIBM)
AC_CHECK_LIB([rt], [clock_gettime], [LIBRT="-lrt"], [LIBRT=""])
AC_SUBST(LIBRT)
+AC_CHECK_FUNCS([openat])
+AM_CONDITIONAL([USE_LIBGSYSTEM], [test x$ac_cv_func_openat = xyes])
+
dnl we need x11 for GnomeBG
PKG_CHECK_MODULES(XLIB, x11,
diff --git a/libgnome-desktop/Makefile.am b/libgnome-desktop/Makefile.am
index 79ed33fe..2389eb18 100644
--- a/libgnome-desktop/Makefile.am
+++ b/libgnome-desktop/Makefile.am
@@ -20,12 +20,14 @@ AM_CPPFLAGS = \
AM_CFLAGS = $(WARN_CFLAGS)
+if USE_LIBGSYSTEM
libgsystem_srcpath := libgsystem
libgsystem_cflags = $(GNOME_DESKTOP_CFLAGS)
libgsystem_libs = $(GNOME_DESKTOP_LIBS)
include libgsystem/Makefile-libgsystem.am
noinst_LTLIBRARIES += libgsystem.la
+endif
introspection_sources = \
gnome-desktop-thumbnail.c \
@@ -79,10 +81,13 @@ libgnome_desktop_3_la_LIBADD = \
$(XLIB_LIBS) \
$(LIBM) \
$(GNOME_DESKTOP_LIBS) \
- libgsystem.la \
$(LIBRT) \
$(NULL)
+if USE_LIBGSYSTEM
+libgnome_desktop_3_la_LIBADD += libgsystem.la
+endif
+
libgnome_desktop_3_la_LDFLAGS = \
-version-info $(LT_VERSION) \
-export-symbols-regex "^gnome_.*" \
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index 330ed7a7..320fba27 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
@@ -145,7 +145,9 @@
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include "gnome-desktop-thumbnail.h"
#include <glib/gstdio.h>
+#ifdef HAVE_OPENAT
#include <libgsystem.h>
+#endif
#define SECONDS_BETWEEN_STATS 10
@@ -485,9 +487,11 @@ _gdk_pixbuf_new_from_uri_at_scale (const char *uri,
}
if (input_stream == NULL) {
+#ifdef HAVE_OPENAT
if (g_file_is_native (file))
input_stream = gs_file_read_noatime (file, NULL, &error);
else
+#endif
input_stream = G_INPUT_STREAM (g_file_read (file, NULL, &error));
if (input_stream == NULL) {
g_warning ("Unable to create an input stream for %s: %s", uri, error->message);