diff options
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/readlink.c | 12 | ||||
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/readlinkat.c | 10 |
2 files changed, 5 insertions, 17 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/readlink.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/readlink.c index f32cd800055..136074af63a 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/readlink.c +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/readlink.c @@ -8,26 +8,20 @@ #include <sys/types.h> #include <unistd.h> -#ifdef __APPLE__ -#define LEN PATH_MAX -#else -#define LEN NAME_MAX -#endif - int main(int argc, char **argv) { - char symlink_path[LEN]; + char symlink_path[PATH_MAX]; snprintf(symlink_path, sizeof(symlink_path), "%s_%d.symlink", argv[0], getpid()); int res = symlink(argv[0], symlink_path); assert(!res); - char readlink_path[LEN]; + char readlink_path[PATH_MAX]; ssize_t res2 = readlink(symlink_path, readlink_path, sizeof(readlink_path)); assert(res2 >= 0); readlink_path[res2] = '\0'; assert(!strcmp(readlink_path, argv[0])); - char readlinkat_path[LEN]; + char readlinkat_path[PATH_MAX]; res2 = readlinkat(AT_FDCWD, symlink_path, readlinkat_path, sizeof(readlink_path)); assert(res2 >= 0); diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/readlinkat.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/readlinkat.c index 0ac06ea616c..62ca7070d89 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/readlinkat.c +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/readlinkat.c @@ -7,20 +7,14 @@ #include <string.h> #include <unistd.h> -#ifdef __APPLE__ -#define LEN PATH_MAX -#else -#define LEN NAME_MAX -#endif - int main(int argc, char **argv) { - char symlink_path[LEN]; + char symlink_path[PATH_MAX]; snprintf(symlink_path, sizeof(symlink_path), "%s_%d.symlink", argv[0], getpid()); int res = symlink(argv[0], symlink_path); assert(!res); - char readlinkat_path[LEN]; + char readlinkat_path[PATH_MAX]; int res2 = readlinkat(AT_FDCWD, symlink_path, readlinkat_path, sizeof(readlinkat_path)); assert(res2 >= 0); |