[gnome-desktop] thumbnail: don't call gs_file_read_noatime() on systems lacking openat()



commit b9547595ac9fa2a08318589e060778de03897242
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Thu Sep 11 17:06:12 2014 +0200

    thumbnail: don't call gs_file_read_noatime() on systems lacking openat()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735974

 configure.ac                               |    3 +++
 libgnome-desktop/Makefile.am               |    7 ++++++-
 libgnome-desktop/gnome-desktop-thumbnail.c |    4 ++++
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 489f7f5..e551436 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 79ed33f..2389eb1 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 330ed7a..320fba2 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]