diff options
author | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2015-05-06 09:28:48 +0000 |
---|---|---|
committer | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2015-05-06 09:28:48 +0000 |
commit | 7fea4d82babe4987f452331c2b72b397d3060ca0 (patch) | |
tree | ec83a33182fd6a93acfc9c42ee82d5e0615fc147 /lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc | |
parent | 09ad9649d7308728b91a1b4f04cbdc1c51b689ef (diff) | |
download | compiler-rt-7fea4d82babe4987f452331c2b72b397d3060ca0.tar.gz |
[Msan] Fix the ioctl_custom.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9459
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@236581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc index 69b7ca9ea..b94c21c96 100644 --- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc @@ -578,14 +578,10 @@ static void ioctl_common_pre(void *ctx, const ioctl_desc *desc, int d, } if (desc->type != ioctl_desc::CUSTOM) return; - switch (request) { - case 0x00008912: { // SIOCGIFCONF - struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; - COMMON_INTERCEPTOR_READ_RANGE(ctx, &ifc->ifc_len, sizeof(ifc->ifc_len)); - break; - } + if (request == IOCTL_SIOCGIFCONF) { + struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; + COMMON_INTERCEPTOR_READ_RANGE(ctx, &ifc->ifc_len, sizeof(ifc->ifc_len)); } - return; } static void ioctl_common_post(void *ctx, const ioctl_desc *desc, int res, int d, @@ -597,12 +593,8 @@ static void ioctl_common_post(void *ctx, const ioctl_desc *desc, int res, int d, } if (desc->type != ioctl_desc::CUSTOM) return; - switch (request) { - case 0x00008912: { // SIOCGIFCONF - struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; - COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ifc->ifc_ifcu.ifcu_req, ifc->ifc_len); - break; - } + if (request == IOCTL_SIOCGIFCONF) { + struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; + COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ifc->ifc_ifcu.ifcu_req, ifc->ifc_len); } - return; } |