Clean up sys_signame and sys_siglist a little.

We don't need quite so much duplication because we already have a way
to get the signal number from its name, and that already copes with the
fact that the mips/mips64 numbers are different from everyone else's.

Also remove sys_signame from LP64. glibc doesn't have this BSD-ism.

Change-Id: I6dc411a3d73589383c85d3b07d9d648311492a10
This commit is contained in:
Elliott Hughes
2014-02-11 19:57:06 -08:00
parent 9e572ca416
commit aa0ebdafc7
7 changed files with 127 additions and 131 deletions

View File

@@ -238,3 +238,17 @@ TEST(signal, sigaction) {
// Put everything back how it was.
ASSERT_EQ(0, sigaction(SIGALRM, &original_sa, NULL));
}
TEST(signal, sys_signame) {
#if defined(__BIONIC__) && !defined(__LP64__)
ASSERT_TRUE(sys_signame[0] == NULL);
ASSERT_STREQ("HUP", sys_signame[SIGHUP]);
#else
GTEST_LOG_(INFO) << "This test does nothing.\n";
#endif
}
TEST(signal, sys_siglist) {
ASSERT_TRUE(sys_siglist[0] == NULL);
ASSERT_STREQ("Hangup", sys_siglist[SIGHUP]);
}