From 0c7dc882a4618e38b3590c9e929b829383596541 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Thu, 13 Aug 2020 21:54:59 +0000 Subject: Remove unncessary memcpy(3) and fix file system ID handling. I removed a bzero() call to reduce compiler warnings in the previous commit (r544829). It turned out the next memcpy() call was also wrong. Just use natural assignments here not to obfuscate the code. Reported by: Martin Simmons (martin at lispworks dot com) (some time ago) --- emulators/virtualbox-ose-additions/Makefile | 1 + .../files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'emulators') diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile index 4413fa5c3b6c..d369fcdf4591 100644 --- a/emulators/virtualbox-ose-additions/Makefile +++ b/emulators/virtualbox-ose-additions/Makefile @@ -3,6 +3,7 @@ PORTNAME= virtualbox-ose PORTVERSION= 5.2.44 +PORTREVISION= 1 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX?= -additions diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c index 353637f0cbed..128085de6cb9 100644 --- a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c +++ b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c @@ -451,8 +451,8 @@ + + MNT_ILOCK(mp); + mp->mnt_data = vboxfsmp; -+ /* f_fsid is int32_t but serial is uint32_t, convert */ -+ memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, sizeof(mp->mnt_stat.f_fsid)); ++ mp->mnt_stat.f_fsid.val[0] = fsinfo.serial; ++ mp->mnt_stat.f_fsid.val[1] = 0; + mp->mnt_flag |= MNT_LOCAL; + if (readonly != 0) + mp->mnt_flag |= MNT_RDONLY; -- cgit v1.2.3