Skip to content

Commit cdf6b58

Browse files
committed
fix cast
1 parent 87f5b10 commit cdf6b58

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Zend/zend_execute_API.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#if defined(ZTS) && defined(HAVE_TIMER_CREATE)
4747
#include <time.h>
4848
#include <sys/syscall.h>
49+
#include <sys/types.h>
4950
// Musl Libc defines this macro, glibc does not
5051
// According to "man 2 timer_create" this field should always be available, but it's not
5152
# ifndef sigev_notify_thread_id
@@ -185,10 +186,10 @@ void init_executor(void) /* {{{ */
185186
sev.sigev_notify = SIGEV_THREAD_ID;
186187
sev.sigev_value.sival_ptr = &EG(timer);
187188
sev.sigev_signo = SIGIO;
188-
sev.sigev_notify_thread_id = syscall(SYS_gettid);
189+
sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid);
189190

190191
if (timer_create(CLOCK_THREAD_CPUTIME_ID, &sev, &EG(timer)) != 0)
191-
fprintf(stderr, "error %d while creating timer on thread %d\n", errno, syscall(SYS_gettid));
192+
fprintf(stderr, "error %d while creating timer on thread %d\n", errno, (pid_t) syscall(SYS_gettid));
192193
# ifdef TIMER_DEBUG
193194
else fprintf(stderr, "timer created on thread %d\n", syscall(SYS_gettid));
194195
# endif
@@ -421,9 +422,9 @@ void shutdown_executor(void) /* {{{ */
421422

422423
#if defined(ZTS) && defined(HAVE_TIMER_CREATE)
423424
if (timer_delete(EG(timer)) != 0)
424-
fprintf(stderr, "error %d while deleting timer on thread %d\n", errno, syscall(SYS_gettid));
425+
fprintf(stderr, "error %d while deleting timer on thread %d\n", errno, (pid_t) syscall(SYS_gettid));
425426
# ifdef TIMER_DEBUG
426-
else fprintf(stderr, "timer deleted on thread %d\n", syscall(SYS_gettid));
427+
else fprintf(stderr, "timer deleted on thread %d\n", (pid_t) syscall(SYS_gettid));
427428
# endif
428429
#endif
429430

@@ -1349,7 +1350,7 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */
13491350
static void zend_timeout_handler(int dummy, siginfo_t *si, void *uc) /* {{{ */
13501351
{
13511352
if (si->si_value.sival_ptr != &EG(timer)) {
1352-
fprintf(stderr, "ignoring timeout signal SIGIO received on thread %d\n", syscall(SYS_gettid));
1353+
fprintf(stderr, "ignoring timeout signal SIGIO received on thread %d\n", (pid_t) syscall(SYS_gettid));
13531354

13541355
return;
13551356
}
@@ -1466,12 +1467,12 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
14661467
its.it_interval.tv_nsec = 0;
14671468

14681469
if (timer_settime(timer, 0, &its, NULL) != 0) {
1469-
fprintf(stderr, "unable to set timer on thread %d\n", syscall(SYS_gettid));
1470+
fprintf(stderr, "unable to set timer on thread %d\n", (pid_t) syscall(SYS_gettid));
14701471

14711472
return;
14721473
}
14731474
# ifdef TIMER_DEBUG
1474-
else fprintf(stderr, "timer set on thread %d (%ld seconds)\n", syscall(SYS_gettid), seconds);
1475+
else fprintf(stderr, "timer set on thread %d (%ld seconds)\n", (pid_t) syscall(SYS_gettid), seconds);
14751476
# endif
14761477

14771478
if (reset_signals) {

0 commit comments

Comments
 (0)