diff options
author | jhb <jhb@FreeBSD.org> | 2015-08-17 19:08:48 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-08-17 19:08:48 +0000 |
commit | ddc112c4e3a39bb6ba627a0a04c2e69ce6645320 (patch) | |
tree | 6d2bd1bf61c1c0c83674a767666d683631525d8e /usr.bin/truss | |
parent | a7ecfcac5413dc4d0d69986acfbe52a5e8ecb48f (diff) | |
download | FreeBSD-src-ddc112c4e3a39bb6ba627a0a04c2e69ce6645320.zip FreeBSD-src-ddc112c4e3a39bb6ba627a0a04c2e69ce6645320.tar.gz |
Use an xlat table and xlookup() instead of a home-rolled version for the
sigprocmask operation type.
Diffstat (limited to 'usr.bin/truss')
-rw-r--r-- | usr.bin/truss/syscalls.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 3132f21..08769f2 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -555,6 +555,11 @@ static struct xlat linux_socketcall_ops[] = { XEND }; +static struct xlat sigprocmask_ops[] = { + X(SIG_BLOCK) X(SIG_UNBLOCK) X(SIG_SETMASK) + XEND +}; + #undef X #undef XEND @@ -1096,15 +1101,7 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval, break; } case Sigprocmask: { - switch (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]); + tmp = strdup(xlookup(sigprocmask_ops, args[sc->offset])); break; } case Fcntlflag: { |