summaryrefslogtreecommitdiffstats
path: root/nsscommon.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2010-03-04 14:11:02 -0500
committerDave Brolley <brolley@redhat.com>2010-03-04 15:02:48 -0500
commit252738c8602263aa20f406c73b0420028f06d3e1 (patch)
tree91d98e52e01cba339e6bb8f1d47b50c2078e72c1 /nsscommon.c
parent4789301fe68c19908025bc4e73f685e2d09e5eb9 (diff)
downloadsystemtap-steved-252738c8602263aa20f406c73b0420028f06d3e1.tar.gz
systemtap-steved-252738c8602263aa20f406c73b0420028f06d3e1.tar.xz
systemtap-steved-252738c8602263aa20f406c73b0420028f06d3e1.zip
Comment on the use of PR_ErrorToString vs static table.
Diffstat (limited to 'nsscommon.c')
-rw-r--r--nsscommon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nsscommon.c b/nsscommon.c
index ea38ffb0..a317cdd3 100644
--- a/nsscommon.c
+++ b/nsscommon.c
@@ -34,15 +34,17 @@ nssError (void)
/* See if PR_GetError can tell us what the error is. */
errorNumber = PR_GetError ();
-
fprintf(stderr, "(%d) ", errorNumber);
+ /* PR_ErrorToString always returns a valid string for errors in this range. */
if (errorNumber >= PR_NSPR_ERROR_BASE && errorNumber <= PR_MAX_ERROR)
{
fprintf (stderr, "%s\n", PR_ErrorToString(errorNumber, PR_LANGUAGE_EN));
return;
}
+ /* PR_ErrorToString does not handle errors outside the range above, so
+ we handle them ourselves. */
switch (errorNumber) {
default: errorText = "(unknown)"; break;
#define NSSYERROR(code,msg) case code: errorText = msg; break