summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xauto/unix9
1 files changed, 7 insertions, 2 deletions
diff --git a/auto/unix b/auto/unix
index ee284e1d1..fadf7dd76 100755
--- a/auto/unix
+++ b/auto/unix
@@ -141,14 +141,19 @@ if [ $ngx_found = no ]; then
ngx_feature_name=NGX_SYS_NERR
ngx_feature_run=value
ngx_feature_incs='#include <errno.h>
+ #include <string.h>'
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='int n;
+ char *p;
for (n = 1; n < 1000; n++) {
errno = 0;
- strerror(n);
- if (errno == EINVAL) {
+ p = strerror(n);
+ if (errno == EINVAL
+ || p == NULL
+ || strncmp(p, "Unknown error", 13) == 0)
+ {
printf("%d", n);
return 0;
}