You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-...

30 lines
1.0 KiB

Author: Larry Finger
Origin: https://www.mail-archive.com/vbox-dev@virtualbox.org/msg09363.html
--- a/src/VBox/Additions/linux/sharedfolders/utils.c
+++ b/src/VBox/Additions/linux/sharedfolders/utils.c
@@ -50,7 +50,11 @@ static void sf_timespec_from_ftime(RTTIMESPEC *ts, time_t *time)
RTTimeSpecSetNano(ts, t);
}
#else /* >= 2.6.0 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
+static void sf_ftime_from_timespec(struct timespec64 *tv, RTTIMESPEC *ts)
+#else
static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
+#endif
{
int64_t t = RTTimeSpecGetNano(ts);
int64_t nsec;
@@ -60,7 +64,11 @@ static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)
tv->tv_nsec = nsec;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
+static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv)
+#else
static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec *tv)
+#endif
{
int64_t t = (int64_t)tv->tv_nsec + (int64_t)tv->tv_sec * 1000000000;
RTTimeSpecSetNano(ts, t);