[PATCH] Bug 16442 - Missing futimes() on Solaris

Игорь Пашев pashev.igor at gmail.com
Wed Jul 3 07:29:44 PDT 2013


Same for lib/Support/Unix/Path.inc.

And now it looks like a mess.

--- lib/Support/Unix/Path.inc   (revision 185535)
+++ lib/Support/Unix/Path.inc   (working copy)
@@ -626,11 +626,21 @@
 }

 error_code setLastModificationAndAccessTime(int FD, TimeValue Time) {
+#if HAVE_FUTIMENS
+  timespec Times[2];
+  Times[0].tv_sec = Time.toPosixTime();
+  Times[0].tv_nsec = 0;
+  Times[1] = Times[0];
+  if (::futimens(FD, Times))
+#elif HAVE_FUTIMES
   timeval Times[2];
   Times[0].tv_sec = Time.toPosixTime();
   Times[0].tv_usec = 0;
   Times[1] = Times[0];
   if (::futimes(FD, Times))
+#else
+#error Missing futimes() and futimens()
+#endif
     return error_code(errno, system_category());
   return error_code::success();
 }



More information about the llvm-commits mailing list