Browse Source

check for signal existence rather than using arch defines

Mike Frysinger 18 years ago
parent
commit
8deadda088

+ 6 - 7
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. */

+ 1 - 1
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
 };

+ 4 - 4
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
 };

+ 2 - 2
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
 };