From 8deadda0884724ab5f7f2cdf6c6f00d1be4ee7db Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 18 Jan 2006 12:16:01 +0000 Subject: check for signal existence rather than using arch defines --- libc/string/__xpg_strerror_r.c | 13 ++++++------- libc/string/_string_syssigmsgs.c | 2 +- libc/string/strsignal.c | 8 ++++---- libc/string/sys_siglist.c | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) (limited to 'libc/string') diff --git a/libc/string/__xpg_strerror_r.c b/libc/string/__xpg_strerror_r.c index 6059cbcbd..6536995e6 100644 --- a/libc/string/__xpg_strerror_r.c +++ b/libc/string/__xpg_strerror_r.c @@ -145,14 +145,14 @@ static const unsigned char estridx[] = { ENAVAIL, EISNAM, EREMOTEIO, -#ifdef __mips__ - 0, /* mips has an outrageous value for this... */ +#if EDQUOT > 200 /* mips has an outrageous value for this... */ + 0, #else EDQUOT, #endif ENOMEDIUM, EMEDIUMTYPE, -#if defined(__mips__) || defined(__sparc__) +#if EDEADLOCK != EDEADLK EDEADLOCK, #endif }; @@ -181,11 +181,10 @@ int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen) } } i = INT_MAX; /* Failed, but may need to check mips special case. */ -#ifdef __mips__ - if (errnum == EDQUOT) { /* Deal with large EDQUOT value on mips */ +#if EDQUOT > 200 /* Deal with large EDQUOT value on mips */ + if (errnum == EDQUOT) i = 122; - } -#endif /* __mips__ */ +#endif GOT_ESTRIDX: #else /* No errno to string index translation needed. */ diff --git a/libc/string/_string_syssigmsgs.c b/libc/string/_string_syssigmsgs.c index a89f582b4..26c0948f4 100644 --- a/libc/string/_string_syssigmsgs.c +++ b/libc/string/_string_syssigmsgs.c @@ -43,7 +43,7 @@ const char _string_syssigmsgs[] = { /* 29: 445, 13 */ "I/O possible\0" /* 30: 458, 14 */ "Power failure\0" /* 31: 472, 16 */ "Bad system call" -#if defined(__alpha__) || defined(__mips__) || defined(__hppa__) || defined(__sparc__) +#if defined SIGEMT /* 32: 488, 9 */ "\0EMT trap" #endif }; diff --git a/libc/string/strsignal.c b/libc/string/strsignal.c index b99facc81..bb5ada716 100644 --- a/libc/string/strsignal.c +++ b/libc/string/strsignal.c @@ -58,10 +58,10 @@ static const unsigned char sstridx[] = { SIGPIPE, SIGALRM, SIGTERM, -#if defined(__alpha__) || defined(__mips__) || defined(__sparc__) - 0, -#else +#if defined SIGSTKFLT SIGSTKFLT, +#else + 0, #endif SIGCHLD, SIGCONT, @@ -78,7 +78,7 @@ static const unsigned char sstridx[] = { SIGIO, SIGPWR, SIGSYS, -#if defined(__alpha__) || defined(__mips__) || defined(__hppa__) || defined(__sparc__) +#if defined SIGEMT SIGEMT, #endif }; diff --git a/libc/string/sys_siglist.c b/libc/string/sys_siglist.c index 0f69856ba..844337536 100644 --- a/libc/string/sys_siglist.c +++ b/libc/string/sys_siglist.c @@ -31,7 +31,7 @@ const char *const sys_siglist[_NSIG] = { [SIGPIPE] = _string_syssigmsgs + 178, [SIGALRM] = _string_syssigmsgs + 190, [SIGTERM] = _string_syssigmsgs + 202, -#if !(defined(__alpha__) || defined(__mips__) || defined(__sparc__)) +#if defined SIGSTKFLT /* not all arches define this, yeah ! */ [SIGSTKFLT] = _string_syssigmsgs + 213, #endif [SIGCHLD] = _string_syssigmsgs + 225, @@ -49,7 +49,7 @@ const char *const sys_siglist[_NSIG] = { [SIGIO] = _string_syssigmsgs + 445, [SIGPWR] = _string_syssigmsgs + 458, [SIGSYS] = _string_syssigmsgs + 472, -#if defined(__alpha__) || defined(__mips__) || defined(__hppa__) || defined(__sparc__) +#if defined SIGEMT /* only some arches define this, yeah ! */ [SIGEMT] = _string_syssigmsgs + 488, #endif }; -- cgit v1.2.3