mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
fix r3822
Solaris strerror() invalid error code behaviour depends on version: Solaris 10 returns "Unknown error" and sets errno to EINVAL, Solaris 9 returns "Unknown error" and leaves errno intact, Solaris 2 returns NULL.
This commit is contained in:
parent
c37192b537
commit
1143d00a16
@ -141,14 +141,19 @@ if [ $ngx_found = no ]; then
|
|||||||
ngx_feature_name=NGX_SYS_NERR
|
ngx_feature_name=NGX_SYS_NERR
|
||||||
ngx_feature_run=value
|
ngx_feature_run=value
|
||||||
ngx_feature_incs='#include <errno.h>
|
ngx_feature_incs='#include <errno.h>
|
||||||
|
#include <string.h>'
|
||||||
#include <stdio.h>'
|
#include <stdio.h>'
|
||||||
ngx_feature_path=
|
ngx_feature_path=
|
||||||
ngx_feature_libs=
|
ngx_feature_libs=
|
||||||
ngx_feature_test='int n;
|
ngx_feature_test='int n;
|
||||||
|
char *p;
|
||||||
for (n = 1; n < 1000; n++) {
|
for (n = 1; n < 1000; n++) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
strerror(n);
|
p = strerror(n);
|
||||||
if (errno == EINVAL) {
|
if (errno == EINVAL
|
||||||
|
|| p == NULL
|
||||||
|
|| strncmp(p, "Unknown error", 13) == 0)
|
||||||
|
{
|
||||||
printf("%d", n);
|
printf("%d", n);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user