mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
Fix missing futimens bug.
This commit is contained in:
2
BUGS
2
BUGS
@@ -33,9 +33,11 @@ Try using tgz-out on a very large directory.
|
||||
|
||||
[libguestfs] futimens (do_touch) not available in glibc 2.5
|
||||
(reported by Charles Duffy)
|
||||
[fixed]
|
||||
|
||||
[ocaml] Does not compile with OCaml 3.09.3 from RHEL 5
|
||||
(reported by Charles Duffy)
|
||||
[fixed]
|
||||
|
||||
[inspector] If there are missing Perl module deps, it still
|
||||
configures the inspector. (eg. if perl-Sys-Virt is missing).
|
||||
|
||||
@@ -59,6 +59,9 @@ AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
|
||||
AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
|
||||
])
|
||||
|
||||
dnl Functions which may not be available in older distributions.
|
||||
AC_CHECK_FUNCS([futimens])
|
||||
|
||||
dnl Produce output files.
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
@@ -33,6 +33,7 @@ int
|
||||
do_touch (const char *path)
|
||||
{
|
||||
int fd;
|
||||
int r;
|
||||
|
||||
NEED_ROOT (-1);
|
||||
ABS_PATH (path, -1);
|
||||
@@ -46,7 +47,12 @@ do_touch (const char *path)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (futimens (fd, NULL) == -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);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user