From 736d3314bff0f3457ee9c86989a2942f4fbce510 Mon Sep 17 00:00:00 2001 From: "Ruslan Bukin ext:(%2C%20Zhang%20Guoye)" Date: Sun, 7 Jun 2015 14:02:40 -0500 Subject: [PATCH] arch: fix build under MacOSX put O_DIRECT under ifdefs -- this fixes build for MacOSX. Also use correct class for arm64 openFlagTable. Committed by: Nilay Vaish --- src/arch/arm/freebsd/freebsd.cc | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/arch/arm/freebsd/freebsd.cc b/src/arch/arm/freebsd/freebsd.cc index feee5686f..bb8514e96 100644 --- a/src/arch/arm/freebsd/freebsd.cc +++ b/src/arch/arm/freebsd/freebsd.cc @@ -47,7 +47,9 @@ OpenFlagTransTable ArmFreebsd32::openFlagTable[] = { { ArmFreebsd32::TGT_O_NONBLOCK, O_NONBLOCK }, { ArmFreebsd32::TGT_O_SYNC, O_SYNC }, { ArmFreebsd32::TGT_FASYNC, FASYNC }, +#ifdef O_DIRECT { ArmFreebsd32::TGT_O_DIRECT, O_DIRECT }, +#endif { ArmFreebsd32::TGT_O_DIRECTORY, O_DIRECTORY }, { ArmFreebsd32::TGT_O_NOFOLLOW, O_NOFOLLOW }, }; @@ -57,20 +59,22 @@ const int ArmFreebsd32::NUM_OPEN_FLAGS = sizeof(ArmFreebsd32::openFlagTable) / // open(2) flags translation table OpenFlagTransTable ArmFreebsd64::openFlagTable[] = { - { ArmFreebsd32::TGT_O_RDONLY, O_RDONLY }, - { ArmFreebsd32::TGT_O_WRONLY, O_WRONLY }, - { ArmFreebsd32::TGT_O_RDWR, O_RDWR }, - { ArmFreebsd32::TGT_O_CREAT, O_CREAT }, - { ArmFreebsd32::TGT_O_EXCL, O_EXCL }, - { ArmFreebsd32::TGT_O_NOCTTY, O_NOCTTY }, - { ArmFreebsd32::TGT_O_TRUNC, O_TRUNC }, - { ArmFreebsd32::TGT_O_APPEND, O_APPEND }, - { ArmFreebsd32::TGT_O_NONBLOCK, O_NONBLOCK }, - { ArmFreebsd32::TGT_O_SYNC, O_SYNC }, - { ArmFreebsd32::TGT_FASYNC, FASYNC }, - { ArmFreebsd32::TGT_O_DIRECT, O_DIRECT }, - { ArmFreebsd32::TGT_O_DIRECTORY, O_DIRECTORY }, - { ArmFreebsd32::TGT_O_NOFOLLOW, O_NOFOLLOW }, + { ArmFreebsd64::TGT_O_RDONLY, O_RDONLY }, + { ArmFreebsd64::TGT_O_WRONLY, O_WRONLY }, + { ArmFreebsd64::TGT_O_RDWR, O_RDWR }, + { ArmFreebsd64::TGT_O_CREAT, O_CREAT }, + { ArmFreebsd64::TGT_O_EXCL, O_EXCL }, + { ArmFreebsd64::TGT_O_NOCTTY, O_NOCTTY }, + { ArmFreebsd64::TGT_O_TRUNC, O_TRUNC }, + { ArmFreebsd64::TGT_O_APPEND, O_APPEND }, + { ArmFreebsd64::TGT_O_NONBLOCK, O_NONBLOCK }, + { ArmFreebsd64::TGT_O_SYNC, O_SYNC }, + { ArmFreebsd64::TGT_FASYNC, FASYNC }, +#ifdef O_DIRECT + { ArmFreebsd64::TGT_O_DIRECT, O_DIRECT }, +#endif + { ArmFreebsd64::TGT_O_DIRECTORY, O_DIRECTORY }, + { ArmFreebsd64::TGT_O_NOFOLLOW, O_NOFOLLOW }, }; const int ArmFreebsd64::NUM_OPEN_FLAGS = sizeof(ArmFreebsd64::openFlagTable) / -- 2.30.2