From e44a7c5333c9bff50adbc5db1e94df6c70cbed76 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 16 Oct 2011 14:24:11 +0000 Subject: [PATCH] Test that only O_RDWR is set. Rename internal symbols to *open64. --- tests/common/open_RDWR_failure.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/common/open_RDWR_failure.c b/tests/common/open_RDWR_failure.c index b2ff8eb2..243d8fb4 100644 --- a/tests/common/open_RDWR_failure.c +++ b/tests/common/open_RDWR_failure.c @@ -18,16 +18,16 @@ typedef int (*open_type) (const char *pathname, int flag, ...); -static open_type next_open; +static open_type next_open64; static const char *failure_path = NULL; int open64 (const char *pathname, int flag, ...) { - if (NULL == next_open) + if (NULL == next_open64) { - next_open = dlsym (RTLD_NEXT, "open64"); - assert (NULL != next_open); + next_open64 = dlsym (RTLD_NEXT, "open64"); + assert (NULL != next_open64); } if (NULL == failure_path) { failure_path = getenv ("FAILURE_PATH"); @@ -37,7 +37,7 @@ int open64 (const char *pathname, int flag, ...) } if ( (NULL != pathname) - && (flag & O_RDWR) + && ((flag & O_ACCMODE) == O_RDWR) && (NULL != failure_path) && (strcmp (pathname, failure_path) == 0)) { @@ -46,6 +46,6 @@ int open64 (const char *pathname, int flag, ...) return -1; } - return next_open (pathname, flag); + return next_open64 (pathname, flag); }