Richard W.M. Jones
2009-Nov-25 12:19 UTC
[Libguestfs] [PATCH] daemon: Use gnulib futimens module.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------->From 77c8469064700ee4f73d76bd58947aa87547067c Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Wed, 25 Nov 2009 12:17:10 +0000 Subject: [PATCH 2/2] daemon: Use gnulib futimens module. Instead of checking for futimens support and falling back (incorrectly in one case) to using futimes, use gnulib's module. However the gnulib module does not yet support Win32, so this change is only really useful on platforms like RHEL 5. --- daemon/.gitignore | 8 ++++++++ daemon/configure.ac | 1 - daemon/file.c | 4 ---- daemon/m4/gnulib-cache.m4 | 3 ++- daemon/utimens.c | 5 ----- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/daemon/.gitignore b/daemon/.gitignore index a55d996..955f7f9 100644 --- a/daemon/.gitignore +++ b/daemon/.gitignore @@ -7,6 +7,7 @@ m4/arpa_inet_h.m4 m4/canonicalize-lgpl.m4 m4/chdir-long.m4 m4/chown.m4 +m4/clock_time.m4 m4/close.m4 m4/codeset.m4 m4/d-ino.m4 @@ -29,6 +30,7 @@ m4/fcntl_h.m4 m4/fdopendir.m4 m4/float_h.m4 m4/fnmatch.m4 +m4/futimens.m4 m4/getcwd-abort-bug.m4 m4/getcwd-path-max.m4 m4/getcwd.m4 @@ -36,6 +38,7 @@ m4/getdelim.m4 m4/getgroups.m4 m4/getline.m4 m4/getlogin_r.m4 +m4/gettime.m4 m4/gettimeofday.m4 m4/getpagesize.m4 m4/getugroups.m4 @@ -116,11 +119,16 @@ m4/sys_time_h.m4 m4/sys_wait_h.m4 m4/tempname.m4 m4/time_h.m4 +m4/timespec.m4 m4/unistd-safer.m4 m4/unistd_h.m4 m4/unlink.m4 m4/unlinkdir.m4 m4/usleep.m4 +m4/utimbuf.m4 +m4/utimecmp.m4 +m4/utimens.m4 +m4/utimes.m4 m4/vasnprintf.m4 m4/vasprintf.m4 m4/warnings.m4 diff --git a/daemon/configure.ac b/daemon/configure.ac index e70f05e..d929a0d 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -170,7 +170,6 @@ AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ dnl Functions which may not be available in older distributions. AC_CHECK_FUNCS([\ - futimens \ getxattr \ inotify_init1 \ lgetxattr \ diff --git a/daemon/file.c b/daemon/file.c index e6bbc19..b8c877f 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -44,11 +44,7 @@ do_touch (const char *path) return -1; } -#ifdef HAVE_FUTIMENS r = futimens (fd, NULL); -#else - r = futimes (fd, NULL); -#endif if (r == -1) { reply_with_perror ("futimens: %s", path); close (fd); diff --git a/daemon/m4/gnulib-cache.m4 b/daemon/m4/gnulib-cache.m4 index 619b89b..5e1d99c 100644 --- a/daemon/m4/gnulib-cache.m4 +++ b/daemon/m4/gnulib-cache.m4 @@ -15,12 +15,13 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl c-ctype getline glob hash ignore-value manywarnings mkdtemp netdb openat readlink select sleep strchrnul strndup sys_select sys_wait vasprintf warnings +# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl c-ctype futimens getline glob hash ignore-value manywarnings mkdtemp netdb openat readlink select sleep strchrnul strndup sys_select sys_wait vasprintf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) gl_MODULES([ c-ctype + futimens getline glob hash diff --git a/daemon/utimens.c b/daemon/utimens.c index 2d0e3bf..e836b4e 100644 --- a/daemon/utimens.c +++ b/daemon/utimens.c @@ -33,10 +33,6 @@ do_utimens (const char *path, int64_t atsecs, int64_t atnsecs, int64_t mtsecs, int64_t mtnsecs) { -#ifndef HAVE_FUTIMENS - reply_with_error ("utimens: not supported in this appliance"); - return -1; -#else int fd; int r; @@ -77,5 +73,4 @@ do_utimens (const char *path, } return 0; -#endif /* HAVE_FUTIMENS */ } -- 1.6.5.2
Reasonably Related Threads
- [PATCH] daemon/Win32: Use Gnulib perror module.
- [PATCH] daemon/Win32: Use gnulib modules for first porting to Win32.
- [PATCH] Don't include gnulib files in POTFILES.in.
- Re: [PATCH 4/4] java: Link with gnulib to resolve missing hash_free symbol.
- [PATCH] daemon/Win32: Use gnulib getaddrinfo module.