]> granicus.if.org Git - strace/commitdiff
keyctl: do not print comma for KEYCTL_SESSION_TO_PARENT command
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 29 Sep 2016 12:56:20 +0000 (15:56 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 2 Oct 2016 19:19:15 +0000 (19:19 +0000)
Since this command doesn't have any additional arguments, the comma does
not needed.  Since this is the only command which lacks additional
arguments, it's better to add special case for it rather than add
printing of comma to all other commands.

* keyctl.c (SYS_FUNC(keyctl)): Add check for command not being
KEYCTL_SESSION_TO_PARENT when printing comma dividing cmd argument
from the rest.

keyctl.c

index 5271d0babe8d4d65340e098f72e81c6c11bb028c..b2099df8875e85f46f3767dcbb6d5919da11d313 100644 (file)
--- a/keyctl.c
+++ b/keyctl.c
@@ -214,7 +214,13 @@ SYS_FUNC(keyctl)
 
        if (entering(tcp)) {
                printxval(keyctl_commands, cmd, "KEYCTL_???");
-               tprints(", ");
+
+               /*
+                * For now, KEYCTL_SESSION_TO_PARENT is the only cmd without
+                * arguments.
+                */
+               if (cmd != KEYCTL_SESSION_TO_PARENT)
+                       tprints(", ");
        }
 
        switch (cmd) {