if (fd < 0)
{
int result = utimensat (AT_FDCWD, file, timespec, 0);
+#ifdef __linux__
+ /* Work around what might be a kernel bug:
+ http://bugzilla.redhat.com/442352
+ http://bugzilla.redhat.com/449910
+ It appears that utimensat can mistakenly return 280 rather
+ than 0 to indicate success.
+ FIXME: remove in 2010 or whenever the offending kernels
+ are no longer in common use. */
+ if (0 < result)
+ result = 0;
+#endif
+
if (result == 0 || errno != ENOSYS)
return result;
}