Skip to content

Commit

Permalink
MFH
Browse files Browse the repository at this point in the history
  • Loading branch information
foobar committed Jun 12, 2001
1 parent b52d710 commit c113584
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/sockets/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PHP_ARG_ENABLE(sockets, whether to enable sockets support,
if test "$PHP_SOCKETS" != "no"; then

AC_CHECK_HEADERS(netdb.h netinet/tcp.h sys/un.h errno.h)
AC_CHECK_FUNCS(hstrerror)
AC_DEFINE(HAVE_SOCKETS, 1, [ ])

PHP_EXTENSION(sockets, $ext_shared)
fi
9 changes: 8 additions & 1 deletion ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,14 @@ PHP_FUNCTION(strerror)
}
if (Z_LVAL_PP(error) < -10000) {
Z_LVAL_PP(error) += 10000;
buf = hstrerror(-(Z_LVAL_PP(error)));
#ifdef HAVE_HSTRERROR
buf = hstrerror(-(Z_LVAL_PP(error)));
#else
{
static char buf[100];
sprintf (buf, "Host lookup error %d", -(Z_LVAL_PP(error)));
}
#endif
} else {
buf = strerror(-(Z_LVAL_PP(error)));
}
Expand Down

0 comments on commit c113584

Please sign in to comment.