Use an xlat table and xlookup() instead of a home-rolled version for the

sigprocmask operation type.
This commit is contained in:
John Baldwin 2015-08-17 19:08:48 +00:00
parent fb7eabb0bf
commit e462b12755
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286860

View File

@ -555,6 +555,11 @@ static struct xlat linux_socketcall_ops[] = {
XEND XEND
}; };
static struct xlat sigprocmask_ops[] = {
X(SIG_BLOCK) X(SIG_UNBLOCK) X(SIG_SETMASK)
XEND
};
#undef X #undef X
#undef XEND #undef XEND
@ -1096,15 +1101,7 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
break; break;
} }
case Sigprocmask: { case Sigprocmask: {
switch (args[sc->offset]) { tmp = strdup(xlookup(sigprocmask_ops, args[sc->offset]));
#define S(a) case a: tmp = strdup(#a); break;
S(SIG_BLOCK);
S(SIG_UNBLOCK);
S(SIG_SETMASK);
#undef S
}
if (tmp == NULL)
asprintf(&tmp, "0x%lx", args[sc->offset]);
break; break;
} }
case Fcntlflag: { case Fcntlflag: {