Hello,
Bug:https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1787441
/var/lib/dkms/virtualbox-guest/5.2.16/build/vboxsf/utils.c: In function 
‘sf_init_inode’:
/var/lib/dkms/virtualbox-guest/5.2.16/build/vboxsf/utils.c:165:28: error: 
passing argument 1 of ‘sf_ftime_from_timespec’ from incompatible pointer 
type [-Werror=incompatible-pointer-types]
     sf_ftime_from_timespec(&inode->i_atime, &info->AccessTime);
                            ^~~~~~~~~~~~~~~
/var/lib/dkms/virtualbox-guest/5.2.16/build/vboxsf/utils.c:53:53: note: 
expected ‘struct timespec *’ but argument is of type ‘struct timespec64 
*’


MIT licensed proposed fix:
diff --git a/src/VBox/Additions/linux/sharedfolders/utils.c 
b/src/VBox/Additions/linux/sharedfolders/utils.c
index 187ba2eff..11ff49a3a 100644
--- 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 timespec *tv, RTTIMESPEC *ts)
+#else
+static void sf_ftime_from_timespec(struct timespec64 *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 timespec *tv)
+#else
+static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv)
+#endif
 {
     int64_t t = (int64_t)tv->tv_nsec + (int64_t)tv->tv_sec * 1000000000;
     RTTimeSpecSetNano(ts, t);

cheers,
Gianfranco
Description: Fix build failure with new kernel 4.18
Author: Gianfranco Costamagna <[email protected]>

diff --git a/src/VBox/Additions/linux/sharedfolders/utils.c b/src/VBox/Additions/linux/sharedfolders/utils.c
index 187ba2eff..11ff49a3a 100644
--- 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 timespec *tv, RTTIMESPEC *ts)
+#else
+static void sf_ftime_from_timespec(struct timespec64 *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 timespec *tv)
+#else
+static void sf_timespec_from_ftime(RTTIMESPEC *ts, struct timespec64 *tv)
+#endif
 {
     int64_t t = (int64_t)tv->tv_nsec + (int64_t)tv->tv_sec * 1000000000;
     RTTimeSpecSetNano(ts, t);
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to