diff options
author | unknown <monty@mysql.com> | 2004-05-25 22:01:50 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-05-25 22:01:50 +0300 |
commit | b287ca53d0b97265478283e4226f5dafb5496ca4 (patch) | |
tree | f5abb32f436bbc05db102bf322757f4a03aaa850 /extra | |
parent | b2882fd4f5401fdc9a1aab57de758848e9831f2e (diff) | |
parent | b3851363ba8df0b3f55ecb358849a212db4b12a8 (diff) | |
download | mariadb-git-b287ca53d0b97265478283e4226f5dafb5496ca4.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/tmp/skr99/mysql-4.0
client/mysqltest.c:
Auto merged
configure.in:
Auto merged
include/my_global.h:
Auto merged
myisam/myisam_ftdump.c:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/mysqld.cc:
Auto merged
Diffstat (limited to 'extra')
-rw-r--r-- | extra/perror.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/extra/perror.c b/extra/perror.c index 6d9744a39da..b4405fdc5dd 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -16,7 +16,7 @@ /* Return error-text for system error messages and nisam messages */ -#define PERROR_VERSION "2.9" +#define PERROR_VERSION "2.10" #include <my_global.h> #include <my_sys.h> @@ -195,16 +195,30 @@ int main(int argc,char *argv[]) else #endif { + /* + 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. + */ + const char *unknown_error= strerror(10000); + for ( ; argc-- > 0 ; argv++) { found=0; code=atoi(*argv); - msg = strerror(code); - if (msg) + msg= strerror(code); + + /* + Don't print message for not existing error messages or for + unknown errors. We test for 'Uknown Errors' just as an + extra safety for Netware + */ + if (msg && strcmp(msg, "Unknown Error") && + (!unknown_error || strcmp(msg, unknown_error))) { found=1; if (verbose) - printf("Error code %3d: %s\n",code,msg); + printf("System error: %3d = %s\n",code,msg); else puts(msg); } @@ -219,7 +233,7 @@ int main(int argc,char *argv[]) else { if (verbose) - printf("%3d = %s\n",code,msg); + printf("MySql error: %3d = %s\n",code,msg); else puts(msg); } |