1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

sapi/fpm: little simplification for the kqueue backend. (#13423)

This commit is contained in:
David CARLIER
2024-02-18 15:01:41 +00:00
committed by GitHub
parent 60518e9695
commit cc934d048c

View File

@@ -79,14 +79,12 @@ static int fpm_event_kqueue_init(int max) /* {{{ */
return -1;
}
kevents = malloc(sizeof(struct kevent) * max);
kevents = calloc(max, sizeof(struct kevent));
if (!kevents) {
zlog(ZLOG_ERROR, "epoll: unable to allocate %d events", max);
return -1;
}
memset(kevents, 0, sizeof(struct kevent) * max);
nkevents = max;
return 0;