diff options
author | Kevin Coffman <kwc@citi.umich.edu> | 2007-10-12 16:34:49 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-10-15 09:50:55 +1000 |
commit | 9d88647ae72b92b497d9590bfa5fd9685033e7d6 (patch) | |
tree | 1a48f1b3c70147c59ae1617f2d1d2c8f725b0829 /utils/gssd/svcgssd_proc.c | |
parent | de72a808a5699a4c6ded5b82c563da0b237d107e (diff) | |
download | nfs-utils-9d88647ae72b92b497d9590bfa5fd9685033e7d6.tar.gz nfs-utils-9d88647ae72b92b497d9590bfa5fd9685033e7d6.tar.xz nfs-utils-9d88647ae72b92b497d9590bfa5fd9685033e7d6.zip |
Make print_hexl function write to stdout rather than using printerr
print_hexl() currently uses printerr, but is really only necessary
for local debugging and should simply write to stdout.
Also change it to print the description internally.
Wrap it and its use in #ifdef DEBUG.
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'utils/gssd/svcgssd_proc.c')
-rw-r--r-- | utils/gssd/svcgssd_proc.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c index 7c58f7b..52c3aaf 100644 --- a/utils/gssd/svcgssd_proc.c +++ b/utils/gssd/svcgssd_proc.c @@ -250,42 +250,43 @@ out: return res; } +#ifdef DEBUG void -print_hexl(int pri, unsigned char *cp, int length) +print_hexl(const char *description, unsigned char *cp, int length) { int i, j, jm; unsigned char c; - printerr(pri, "length %d\n",length); - printerr(pri, "\n"); + printf("%s (length %d)\n", description, length); for (i = 0; i < length; i += 0x10) { - printerr(pri, " %04x: ", (u_int)i); + printf(" %04x: ", (u_int)i); jm = length - i; jm = jm > 16 ? 16 : jm; for (j = 0; j < jm; j++) { if ((j % 2) == 1) - printerr(pri,"%02x ", (u_int)cp[i+j]); + printf("%02x ", (u_int)cp[i+j]); else - printerr(pri,"%02x", (u_int)cp[i+j]); + printf("%02x", (u_int)cp[i+j]); } for (; j < 16; j++) { if ((j % 2) == 1) - printerr(pri," "); + printf(" "); else - printerr(pri," "); + printf(" "); } - printerr(pri," "); + printf(" "); for (j = 0; j < jm; j++) { c = cp[i+j]; c = isprint(c) ? c : '.'; - printerr(pri,"%c", c); + printf("%c", c); } - printerr(pri,"\n"); + printf("\n"); } } +#endif void handle_nullreq(FILE *f) { @@ -326,13 +327,15 @@ handle_nullreq(FILE *f) { in_handle.length = (size_t) qword_get(&cp, in_handle.value, sizeof(in_handle_buf)); - printerr(2, "in_handle: \n"); - print_hexl(2, in_handle.value, in_handle.length); +#ifdef DEBUG + print_hexl("in_handle", in_handle.value, in_handle.length); +#endif in_tok.length = (size_t) qword_get(&cp, in_tok.value, sizeof(in_tok_buf)); - printerr(2, "in_tok: \n"); - print_hexl(2, in_tok.value, in_tok.length); +#ifdef DEBUG + print_hexl("in_tok", in_tok.value, in_tok.length); +#endif if (in_tok.length < 0) { printerr(0, "WARNING: handle_nullreq: " |