From df0b22c5a852e6b5fd9c41efc0cb567e6fc3075f Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 30 Jan 2015 23:04:54 +0000 Subject: [PATCH] Remove unused function. llvm-svn: 227633 --- compiler-rt/lib/sanitizer_common/sanitizer_common.h | 1 - compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc | 11 ----------- .../lib/sanitizer_common/tests/sanitizer_linux_test.cc | 8 -------- 3 files changed, 20 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h index 07641b6..80adfa1 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h @@ -210,7 +210,6 @@ void DisableCoreDumperIfNecessary(); void DumpProcessMap(); bool FileExists(const char *filename); const char *GetEnv(const char *name); -bool SetEnv(const char *name, const char *value); const char *GetPwd(); char *FindPathToBinary(const char *name); u32 GetUid(); diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc index 1c0a2f1..a5a8d0a 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc @@ -120,17 +120,6 @@ void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top, *stack_bottom = (uptr)stackaddr; } -bool SetEnv(const char *name, const char *value) { - void *f = dlsym(RTLD_NEXT, "setenv"); - if (f == 0) - return false; - typedef int(*setenv_ft)(const char *name, const char *value, int overwrite); - setenv_ft setenv_f; - CHECK_EQ(sizeof(setenv_f), sizeof(f)); - internal_memcpy(&setenv_f, &f, sizeof(f)); - return setenv_f(name, value, 1) == 0; -} - bool SanitizerSetThreadName(const char *name) { #ifdef PR_SET_NAME return 0 == prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); // NOLINT diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc index 592d9c3..2a3ba31 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc @@ -187,14 +187,6 @@ TEST_F(ThreadListerTest, ResetMakesNewThreadsKnown) { ASSERT_TRUE(HasElement(threads_after_extra, extra_tid)); } -TEST(SanitizerCommon, SetEnvTest) { - const char kEnvName[] = "ENV_FOO"; - SetEnv(kEnvName, "value"); - EXPECT_STREQ("value", getenv(kEnvName)); - unsetenv(kEnvName); - EXPECT_EQ(0, getenv(kEnvName)); -} - #if defined(__x86_64__) || defined(__i386__) void *thread_self_offset_test_func(void *arg) { bool result = -- 2.7.4