Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / support / sys-time.c
index 376346a45743e6116f7ffae0ac68657d73b5b649..83afa0c8466b65f1a565d529cd01af9a7a728510 100644 (file)
@@ -47,6 +47,11 @@ Mono_Posix_Syscall_settimeofday (
        struct Mono_Posix_Timeval *tv,
        struct Mono_Posix_Timezone *tz)
 {
+#if defined(__HAIKU__)
+       /* FIXME: Haiku doesn't support this either, consider
+           using set_real_time_clock instead? */
+       return -1;
+#else
        struct timeval _tv   = {0};
        struct timeval *ptv  = NULL;
        struct timezone _tz  = {0};
@@ -67,33 +72,17 @@ Mono_Posix_Syscall_settimeofday (
        r = settimeofday (ptv, ptz);
 
        return r;
-}
-
-/* Remove this at some point in the future */
-gint32
-Mono_Posix_Syscall_utimes_bad (const char *filename,
-       struct Mono_Posix_Timeval *tv)
-{
-       struct timeval _tv;
-       struct timeval *ptv = NULL;
-
-       if (tv) {
-               _tv.tv_sec  = tv->tv_sec;
-               _tv.tv_usec = tv->tv_usec;
-               ptv = &_tv;
-       }
-
-       return utimes (filename, ptv);
+#endif
 }
 
 static inline struct timeval*
 copy_utimes (struct timeval* to, struct Mono_Posix_Timeval *from)
 {
        if (from) {
-               to[0].tv_sec  = from->tv_sec;
-               to[0].tv_usec = from->tv_usec;
-               to[1].tv_sec  = from->tv_sec;
-               to[1].tv_usec = from->tv_usec;
+               to[0].tv_sec  = from[0].tv_sec;
+               to[0].tv_usec = from[0].tv_usec;
+               to[1].tv_sec  = from[1].tv_sec;
+               to[1].tv_usec = from[1].tv_usec;
                return to;
        }
 
@@ -124,6 +113,7 @@ Mono_Posix_Syscall_lutimes(const char *filename, struct Mono_Posix_Timeval *tv)
 }
 #endif /* def HAVE_LUTIMES */
 
+#if HAVE_FUTIMES
 gint32
 Mono_Posix_Syscall_futimes(int fd, struct Mono_Posix_Timeval *tv)
 {
@@ -134,6 +124,7 @@ Mono_Posix_Syscall_futimes(int fd, struct Mono_Posix_Timeval *tv)
 
        return futimes (fd, ptv);
 }
+#endif  /* def HAVE_FUTIMES */
 
 G_END_DECLS