fuse/RHEL: Don't require UTIME_{NOW,OMIT} to be defined.
authorRichard Jones <rjones@centos5x32.home.annexia.org>
Wed, 18 Nov 2009 16:01:23 +0000 (16:01 +0000)
committerRichard Jones <rjones@redhat.com>
Wed, 18 Nov 2009 17:33:17 +0000 (17:33 +0000)
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

index baf2b66..05cacef 100644 (file)
@@ -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;
 
   time_t mtsecs = ts[1].tv_sec;
   long mtnsecs = ts[1].tv_nsec;
 
+#ifdef UTIME_NOW
   if (atnsecs == UTIME_NOW)
     atnsecs = -1;
   if (atnsecs == UTIME_NOW)
     atnsecs = -1;
+#endif
+#ifdef UTIME_OMIT
   if (atnsecs == UTIME_OMIT)
     atnsecs = -2;
   if (atnsecs == UTIME_OMIT)
     atnsecs = -2;
+#endif
+#ifdef UTIME_NOW
   if (mtnsecs == UTIME_NOW)
     mtnsecs = -1;
   if (mtnsecs == UTIME_NOW)
     mtnsecs = -1;
+#endif
+#ifdef UTIME_OMIT
   if (mtnsecs == UTIME_OMIT)
     mtnsecs = -2;
   if (mtnsecs == UTIME_OMIT)
     mtnsecs = -2;
+#endif
 
   r = guestfs_utimens (g, path, atsecs, atnsecs, mtsecs, mtnsecs);
   if (r == -1)
 
   r = guestfs_utimens (g, path, atsecs, atnsecs, mtsecs, mtnsecs);
   if (r == -1)