diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-10-14 17:02:47 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-10-14 17:05:40 -0400 |
commit | 739cf6877b9bd84b0aba47f5c4c205a9dd63a93d (patch) | |
tree | 4e8f02f3a1a668084ef6f6202826d85016369c22 /stap-server-connect.c | |
parent | 85dfc5c81e213a1fc67c8c50d0e1101659c61d6e (diff) | |
download | systemtap-steved-739cf6877b9bd84b0aba47f5c4c205a9dd63a93d.tar.gz systemtap-steved-739cf6877b9bd84b0aba47f5c4c205a9dd63a93d.tar.xz systemtap-steved-739cf6877b9bd84b0aba47f5c4c205a9dd63a93d.zip |
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 <stapsslerr.h>.
* stap-{client,server}-connect.c (errWarn): Standardize on nssError().
* Makefile.am (nss binaries): Also link in nsscommon.c.
Diffstat (limited to 'stap-server-connect.c')
-rw-r--r-- | stap-server-connect.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <nss.h> #include <pk11func.h> +#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 |