diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-03-11 10:22:58 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-03-11 10:22:58 +0000 |
commit | 003fbdfe5d8b237f42f575199b742c8dde9b8a11 (patch) | |
tree | dc1d6b3709d28898a7fd559a348ca007f89e9b3b | |
parent | 15ba6ae17d5272d3d906f4053ed424447dc910bd (diff) | |
download | libguestfs-003fbdfe5d8b237f42f575199b742c8dde9b8a11.tar.gz libguestfs-003fbdfe5d8b237f42f575199b742c8dde9b8a11.tar.xz libguestfs-003fbdfe5d8b237f42f575199b742c8dde9b8a11.zip |
RHEL5: Make use of 'futimens' function optional.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/appliance.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 8f1ad6ff..6a808ff3 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/src/appliance.c b/src/appliance.c index ef724be5..99bb21f7 100644 --- a/src/appliance.c +++ b/src/appliance.c @@ -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; |