summaryrefslogtreecommitdiff
path: root/extra/perror.c
diff options
context:
space:
mode:
Diffstat (limited to 'extra/perror.c')
-rw-r--r--extra/perror.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/extra/perror.c b/extra/perror.c
index e82ff08ad5d..3b7560837b9 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -239,10 +239,24 @@ int main(int argc,char *argv[])
if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
(ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
{
- msg= 0;
+ msg= 0;
}
else
msg= ndb_string;
+ if (msg)
+ {
+ if (verbose)
+ printf("NDB error code %3d: %s\n",code,msg);
+ else
+ puts(msg);
+ }
+ else
+ {
+ fprintf(stderr,"Illegal ndb error code: %d\n",code);
+ error= 1;
+ }
+ found= 1;
+ msg= 0;
}
else
#endif