From: Eugene Syromyatnikov Date: Thu, 29 Sep 2016 12:56:35 +0000 (+0300) Subject: keyctl: print errno name in KEYCTL_REJECT in case it is available X-Git-Tag: v4.14~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7211bdb982e588f0d9622784ec84a3e9fa06fdd6;p=strace keyctl: print errno name in KEYCTL_REJECT in case it is available * keyctl.c (keyctl_reject_key): Get errno string via err_name and print it if it is not NULL. --- diff --git a/keyctl.c b/keyctl.c index b2099df8..894af62b 100644 --- a/keyctl.c +++ b/keyctl.c @@ -175,8 +175,16 @@ static void keyctl_reject_key(struct tcb *tcp, key_serial_t id1, unsigned timeout, unsigned error, key_serial_t id2) { + const char *err_str = err_name(error); + print_keyring_serial_number(id1); - tprintf(", %u, %u, ", timeout, error); + tprintf(", %u, ", timeout); + + if (err_str) + tprintf("%s, ", err_str); + else + tprintf("%u, ", error); + print_keyring_serial_number(id2); }