From 146b732fc877a23d515191471603a9ef0a655501 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 13 Nov 2009 16:40:53 +0000 Subject: [PATCH] Translate messages from ktc_SetToken Error messages from ktc_SetToken weren't being passed through com_err, leading to the confusing unable to obtain tokens for cell inf.ed.ac.uk (status: 11862788). error message. Instead, call into afs_com_err here, which gives: a pioctl failed while obtaining tokens for cell inf.ed.ac.uk Much nicer ... Change-Id: Id4c7e6f6a2f52efc6ac1db9fa007ba1a452092fe Reviewed-on: http://gerrit.openafs.org/822 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/aklog/aklog_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c index 6c70217602..3c2a421939 100644 --- a/src/aklog/aklog_main.c +++ b/src/aklog/aklog_main.c @@ -818,8 +818,9 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) strcpy(aclient.instance, ""); strncpy(aclient.cell, realm_of_user, MAXKTCREALMLEN - 1); if ((status = ktc_SetToken(&aserver, &atoken, &aclient, 0))) { - fprintf(stderr, "%s: unable to obtain tokens for cell %s " - "(status: %d).\n", progname, cell_to_use, status); + afs_com_err(progname, status, + "while obtaining tokens for cell %s", + cell_to_use); status = AKLOG_TOKEN; } @@ -877,9 +878,8 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) write(2,"",0); /* dummy write */ #endif if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) { - fprintf(stderr, - "%s: unable to obtain tokens for cell %s (status: %d).\n", - progname, cell_to_use, status); + afs_com_err(progname, status, "while obtaining tokens for cell %s", + cell_to_use); status = AKLOG_TOKEN; } }