RHEL5: Make use of 'futimens' function optional.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 11 Mar 2011 10:22:58 +0000 (10:22 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 21 Mar 2011 11:14:14 +0000 (11:14 +0000)
(cherry picked from commit 003fbdfe5d8b237f42f575199b742c8dde9b8a11)

configure.ac
src/appliance.c

index d98fe49..b62db1a 100644 (file)
@@ -158,7 +158,7 @@ dnl Headers.
 AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h endian.h byteswap.h])
 
 dnl Functions.
-AC_CHECK_FUNCS([posix_fallocate])
+AC_CHECK_FUNCS([futimens posix_fallocate])
 
 dnl Build the daemon?
 AC_MSG_CHECKING([if we should build the daemon])
index 1b6b505..906b6a9 100644 (file)
@@ -351,7 +351,11 @@ check_for_cached_appliance (guestfs_h *g,
   int fd = open (filename, O_RDONLY);
   if (fd == -1)
     return 0;
+#ifdef HAVE_FUTIMENS
   (void) futimens (fd, NULL);
+#else
+  (void) futimes (fd, NULL);
+#endif
   struct flock fl;
   fl.l_type = F_RDLCK;
   fl.l_whence = SEEK_SET;