Richard W.M. Jones
2009-Nov-18 16:05 UTC
[Libguestfs] [PATCH] fuse/RHEL: Don't require UTIME_{NOW, OMIT} to be defined.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -------------- next part -------------->From 298c7e2db9b1be751928844553339fa0317a54c3 Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at centos5x32.home.annexia.org> Date: Wed, 18 Nov 2009 16:01:23 +0000 Subject: [PATCH] fuse/RHEL: Don't require UTIME_{NOW,OMIT} to be defined. These macros don't exist on RHEL/CentOS 5.4. If the feature is missing then just don't implement it in the FUSE layer. --- fuse/guestmount.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fuse/guestmount.c b/fuse/guestmount.c index baf2b66..05cacef 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -534,14 +534,22 @@ fg_utimens (const char *path, const struct timespec ts[2]) time_t mtsecs = ts[1].tv_sec; long mtnsecs = ts[1].tv_nsec; +#ifdef UTIME_NOW if (atnsecs == UTIME_NOW) atnsecs = -1; +#endif +#ifdef UTIME_OMIT if (atnsecs == UTIME_OMIT) atnsecs = -2; +#endif +#ifdef UTIME_NOW if (mtnsecs == UTIME_NOW) mtnsecs = -1; +#endif +#ifdef UTIME_OMIT if (mtnsecs == UTIME_OMIT) mtnsecs = -2; +#endif r = guestfs_utimens (g, path, atsecs, atnsecs, mtsecs, mtnsecs); if (r == -1) -- 1.5.5.6
Jim Meyering
2009-Nov-18 17:53 UTC
[Libguestfs] [PATCH] fuse/RHEL: Don't require UTIME_{NOW, OMIT} to be defined.
Richard W.M. Jones wrote: ...> Subject: [PATCH] fuse/RHEL: Don't require UTIME_{NOW,OMIT} to be defined. > > These macros don't exist on RHEL/CentOS 5.4. If the feature > is missing then just don't implement it in the FUSE layer. > --- > fuse/guestmount.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/fuse/guestmount.c b/fuse/guestmount.c > index baf2b66..05cacef 100644 > --- a/fuse/guestmount.c > +++ b/fuse/guestmount.c > @@ -534,14 +534,22 @@ fg_utimens (const char *path, const struct timespec ts[2]) > time_t mtsecs = ts[1].tv_sec; > long mtnsecs = ts[1].tv_nsec; > > +#ifdef UTIME_NOW > if (atnsecs == UTIME_NOW) > atnsecs = -1; > +#endif > +#ifdef UTIME_OMIT > if (atnsecs == UTIME_OMIT) > atnsecs = -2; > +#endif > +#ifdef UTIME_NOW > if (mtnsecs == UTIME_NOW) > mtnsecs = -1; > +#endif > +#ifdef UTIME_OMIT > if (mtnsecs == UTIME_OMIT) > mtnsecs = -2; > +#endifLooks obviously correct.
Possibly Parallel Threads
- [PATCH v2] New APIs: mount-local and umount-local using FUSE
- [PATCH 0/3] Enable FUSE support in the API via 'mount-local' call.
- [PATCH v3] New APIs: mount-local, mount-local-run and umount-local using FUSE
- Build problem on CentOS 5.4
- [PATCH] Fix small issues in documentations of APIs