From 739cf6877b9bd84b0aba47f5c4c205a9dd63a93d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 14 Oct 2009 17:02:47 -0400 Subject: PR10331: improve nss error message handling * stapsslerr.h: New file containing NSS* error number to string mappings. Originally from mozilla NSS documentation, also seen in other GPLv2 software. * nsscommon.c (nssError): Print error number, and text from . * stap-{client,server}-connect.c (errWarn): Standardize on nssError(). * Makefile.am (nss binaries): Also link in nsscommon.c. --- stap-server-connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'stap-server-connect.c') diff --git a/stap-server-connect.c b/stap-server-connect.c index e93ae37b..cbbc97d1 100644 --- a/stap-server-connect.c +++ b/stap-server-connect.c @@ -31,6 +31,8 @@ #include #include +#include "nsscommon.h" + #define READ_BUFFER_SIZE (60 * 1024) /* Global variables */ @@ -55,9 +57,8 @@ Usage(const char *progName) static void errWarn(char *function) { - PRErrorCode errorNumber = PR_GetError(); - - printf("Error in function %s: %d\n\n", function, errorNumber); + fprintf(stderr, "Error in function %s: ", function); + nssError(); } static void -- cgit