diff options
author | unknown <msvensson@neptunus.(none)> | 2006-08-01 20:24:30 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-08-01 20:24:30 +0200 |
commit | 1081dd6f0da5814fecad628d509e71c250ad1730 (patch) | |
tree | 846b441c9730546494aa063e2bc4f74751efde48 /extra | |
parent | edeea349b9cf8125c3ca19eff144b1334fddad28 (diff) | |
parent | 2660a6bb5936a215876468e94fb88b3f0c58f3bf (diff) | |
download | mariadb-git-1081dd6f0da5814fecad628d509e71c250ad1730.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
configure.in:
Auto merged
client/mysql.cc:
Auto merged
client/mysqldump.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/federated.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/mysql.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
sql/field.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'extra')
-rw-r--r-- | extra/perror.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/extra/perror.c b/extra/perror.c index 82311c1b2c9..b26e516a101 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -218,8 +218,11 @@ int main(int argc,char *argv[]) On some system, like NETWARE, strerror(unknown_error) returns a string 'Unknown Error'. To avoid printing it we try to find the error string by asking for an impossible big error message. + + On Solaris 2.8 it might return NULL */ - msg= strerror(10000); + if ((msg= strerror(10000)) == NULL) + msg= "Unknown Error"; /* Allocate a buffer for unknown_error since strerror always returns @@ -258,7 +261,7 @@ int main(int argc,char *argv[]) found= 1; msg= 0; } - else + else #endif msg = strerror(code); @@ -278,20 +281,23 @@ int main(int argc,char *argv[]) else puts(msg); } - if (!(msg=get_ha_error_msg(code))) + + if (!found) { - if (!found) - { + /* Error message still not found, look in handler error codes */ + if (!(msg=get_ha_error_msg(code))) + { fprintf(stderr,"Illegal error code: %d\n",code); error=1; - } - } - else - { - if (verbose) - printf("MySQL error code %3d: %s\n",code,msg); - else - puts(msg); + } + else + { + found= 1; + if (verbose) + printf("MySQL error code %3d: %s\n",code,msg); + else + puts(msg); + } } } } |