#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+/* Glibc has an efficient macro for sigemptyset
+ * (it just does one or two assignments of 0 to internal vector of longs).
+ */
+#if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset)
+# define sigemptyset __sigemptyset
+#endif
+
/* Configuration section */
#ifndef MAX_QUALS
# if defined(MIPS)
int i;
int rc = -1;
- if (isdigit((unsigned char)*s)) {
+ if (*s >= '0' && *s <= '9') {
int i = atoi(s);
if (i < 0 || i >= MAX_QUALS)
return -1;
qual_signal(const char *s, int bitflag, int not)
{
int i;
- char buf[32];
- if (isdigit((unsigned char)*s)) {
+ if (*s >= '0' && *s <= '9') {
int signo = atoi(s);
if (signo < 0 || signo >= MAX_QUALS)
return -1;
qualify_one(signo, bitflag, not, -1);
return 0;
}
- if (strlen(s) >= sizeof buf)
- return -1;
- strcpy(buf, s);
- s = buf;
if (strncasecmp(s, "SIG", 3) == 0)
s += 3;
- for (i = 0; i <= NSIG; i++)
+ for (i = 0; i <= NSIG; i++) {
if (strcasecmp(s, signame(i) + 3) == 0) {
qualify_one(i, bitflag, not, -1);
return 0;
}
+ }
return -1;
}
static int
qual_desc(const char *s, int bitflag, int not)
{
- if (isdigit((unsigned char)*s)) {
+ if (*s >= '0' && *s <= '9') {
int desc = atoi(s);
if (desc < 0 || desc >= MAX_QUALS)
return -1;