summaryrefslogtreecommitdiffstats
path: root/nsscommon.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2010-03-03 15:03:10 -0500
committerDave Brolley <brolley@redhat.com>2010-03-03 15:44:28 -0500
commita2f05a98d7ed062f293f40f88fc1237448438b15 (patch)
treec93a6f74acac0a41d15fdbff02dd06eb6e5260df /nsscommon.c
parentb561f990a9849e65e45668608ad4639b6392f88a (diff)
downloadsystemtap-steved-a2f05a98d7ed062f293f40f88fc1237448438b15.tar.gz
systemtap-steved-a2f05a98d7ed062f293f40f88fc1237448438b15.tar.xz
systemtap-steved-a2f05a98d7ed062f293f40f88fc1237448438b15.zip
Improved NSPR error handling. Use PR_ErrorToString.
Diffstat (limited to 'nsscommon.c')
-rw-r--r--nsscommon.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/nsscommon.c b/nsscommon.c
index b94e3e63..ea38ffb0 100644
--- a/nsscommon.c
+++ b/nsscommon.c
@@ -1,7 +1,7 @@
/*
Common functions used by the NSS-aware code in systemtap.
- Copyright (C) 2009 Red Hat Inc.
+ Copyright (C) 2009, 2010 Red Hat Inc.
This file is part of systemtap, and is free software. You can
redistribute it and/or modify it under the terms of the GNU General Public
@@ -30,27 +30,17 @@ void
nssError (void)
{
PRErrorCode errorNumber;
- PRInt32 errorTextLength;
- PRInt32 rc;
char *errorText;
- /* See if PR_GetErrorText can tell us what the error is. */
+ /* See if PR_GetError can tell us what the error is. */
errorNumber = PR_GetError ();
fprintf(stderr, "(%d) ", errorNumber);
if (errorNumber >= PR_NSPR_ERROR_BASE && errorNumber <= PR_MAX_ERROR)
{
- errorTextLength = PR_GetErrorTextLength ();
- if (errorTextLength != 0) {
- errorText = PORT_Alloc (errorTextLength);
- rc = PR_GetErrorText (errorText);
- if (rc != 0)
- fprintf (stderr, "%s\n", errorText);
- PR_Free (errorText);
- if (rc != 0)
- return;
- }
+ fprintf (stderr, "%s\n", PR_ErrorToString(errorNumber, PR_LANGUAGE_EN));
+ return;
}
switch (errorNumber) {