Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ AX_FUNC_WHICH_GETHOSTBYNAME_R
dnl Some systems (like OpenSolaris) do not have nanosleep in libc.
PHP_CHECK_FUNC_LIB(nanosleep, rt)

dnl Haiku does not have network api in libc.
PHP_CHECK_FUNC_LIB(setsockopt, network)

dnl Check for getaddrinfo, should be a better way, but... Also check for working
dnl getaddrinfo.
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
Expand Down
7 changes: 2 additions & 5 deletions ext/gd/libgd/gd_jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef struct _jmpbuf_wrapper
int ignore_warning;
} jmpbuf_wrapper;

static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
static void php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
{
char message[JMSG_LENGTH_MAX];
jmpbuf_wrapper *jmpbufw;
Expand Down Expand Up @@ -81,11 +81,9 @@ static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
}
}
}
return 1;
}



/* Called by the IJG JPEG library upon encountering a fatal error */
static void fatal_jpeg_error (j_common_ptr cinfo)
{
Expand Down Expand Up @@ -356,8 +354,7 @@ gdImagePtr gdImageCreateFromJpegCtxEx (gdIOCtx * infile, int ignore_warning)

cinfo.err = jpeg_std_error (&jerr);
cinfo.client_data = &jmpbufw;

cinfo.err->emit_message = (void (*)(j_common_ptr,int)) php_jpeg_emit_message;
cinfo.err->emit_message = php_jpeg_emit_message;

if (setjmp (jmpbufw.jmpbuf) != 0) {
/* we're here courtesy of longjmp */
Expand Down
5 changes: 3 additions & 2 deletions ext/opcache/jit/zend_jit_perf_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
#include <unistd.h>
#include <time.h>
#include <sys/mman.h>
#include <sys/syscall.h>

#if defined(__darwin__)
#if defined(__linux__)
#include <sys/syscall.h>
#elif defined(__darwin__)
# include <pthread.h>
#elif defined(__FreeBSD__)
# include <sys/thr.h>
Expand Down
18 changes: 18 additions & 0 deletions ext/posix/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,14 @@ PHP_FUNCTION(posix_getgrgid)

grbuf = emalloc(grbuflen);

try_again:
ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);
if (ret || retgrptr == NULL) {
if (errno == ERANGE) {
grbuflen *= 2;
grbuf = erealloc(grbuf, grbuflen);
goto try_again;
}
POSIX_G(last_error) = ret;
efree(grbuf);
RETURN_FALSE;
Expand Down Expand Up @@ -952,7 +958,13 @@ PHP_FUNCTION(posix_getpwnam)
buf = emalloc(buflen);
pw = &pwbuf;

try_again:
if (getpwnam_r(name, pw, buf, buflen, &pw) || pw == NULL) {
if (errno == ERANGE) {
buflen *= 2;
buf = erealloc(buf, buflen);
goto try_again;
}
efree(buf);
POSIX_G(last_error) = errno;
RETURN_FALSE;
Expand Down Expand Up @@ -1001,8 +1013,14 @@ PHP_FUNCTION(posix_getpwuid)
}
pwbuf = emalloc(pwbuflen);

try_again:
ret = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
if (ret || retpwptr == NULL) {
if (errno == ERANGE) {
pwbuflen *= 2;
pwbuf = erealloc(pwbuf, pwbuflen);
goto try_again;
}
POSIX_G(last_error) = ret;
efree(pwbuf);
RETURN_FALSE;
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/microtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ PHP_FUNCTION(getrusage)
#ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */
PHP_RUSAGE_PARA(ru_majflt);
PHP_RUSAGE_PARA(ru_maxrss);
#elif !defined(_OSD_POSIX)
#elif !defined(_OSD_POSIX) && !defined(__HAIKU__)
PHP_RUSAGE_PARA(ru_oublock);
PHP_RUSAGE_PARA(ru_inblock);
PHP_RUSAGE_PARA(ru_msgsnd);
Expand Down
3 changes: 3 additions & 0 deletions sapi/phpdbg/phpdbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,9 @@ int main(int argc, char **argv) /* {{{ */
}

#ifndef _WIN32
# ifndef SIGIO
# define SIGIO SIGPOLL
# endif
zend_sigaction(SIGIO, &sigio_struct, NULL);
#endif

Expand Down