From: Eugene Syromyatnikov Date: Wed, 4 Apr 2018 12:12:08 +0000 (+0200) Subject: fcntl: replace combinations of xlookup and printxval with printxvals X-Git-Tag: v4.23~285 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39530d489a986515651632dc8c102dd8eaa72ea6;p=strace fcntl: replace combinations of xlookup and printxval with printxvals After all, that's what printxvals for. * fcntl.c (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use printxvals for printing value with multiple xlat tables as constant sources. --- diff --git a/fcntl.c b/fcntl.c index a42489bd..3abce7fd 100644 --- a/fcntl.c +++ b/fcntl.c @@ -198,17 +198,13 @@ SYS_FUNC(fcntl) printfd(tcp, tcp->u_arg[0]); tprints(", "); const unsigned int cmd = tcp->u_arg[1]; - const char *str = xlookup(fcntlcmds, cmd); - if (str) { - tprints(str); - } else { - /* - * fcntl syscall does not recognize these - * constants, but we would like to show them - * for better debugging experience. - */ - printxval(fcntl64cmds, cmd, "F_???"); - } + + /* + * fcntl syscall does not recognize fcntl64 command constants, + * but we would like to show them for better debugging + * experience. + */ + printxvals(cmd, "F_???", fcntlcmds, fcntl64cmds, NULL); } return print_fcntl(tcp); } @@ -219,12 +215,7 @@ SYS_FUNC(fcntl64) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - const char *str = xlookup(fcntl64cmds, cmd); - if (str) { - tprints(str); - } else { - printxval(fcntlcmds, cmd, "F_???"); - } + printxvals(cmd, "F_???", fcntl64cmds, fcntlcmds, NULL); } switch (cmd) { case F_SETLK64: