16
16
17
17
typedef struct {
18
18
php_poll_fd_table * fd_table ;
19
- struct pollfd * temp_fds ;
19
+ php_pollfd * temp_fds ;
20
20
int temp_fds_capacity ;
21
21
} poll_backend_data_t ;
22
22
@@ -76,7 +76,7 @@ static zend_result poll_backend_init(php_poll_ctx *ctx)
76
76
return FAILURE ;
77
77
}
78
78
79
- data -> temp_fds = php_poll_calloc (initial_capacity , sizeof (struct pollfd ), ctx -> persistent );
79
+ data -> temp_fds = php_poll_calloc (initial_capacity , sizeof (php_pollfd ), ctx -> persistent );
80
80
if (!data -> temp_fds ) {
81
81
php_poll_fd_table_cleanup (data -> fd_table );
82
82
pefree (data , ctx -> persistent );
@@ -160,13 +160,13 @@ static zend_result poll_backend_remove(php_poll_ctx *ctx, int fd)
160
160
return SUCCESS ;
161
161
}
162
162
163
- /* Context for building pollfd array */
163
+ /* Context for building php_pollfd array */
164
164
typedef struct {
165
- struct pollfd * fds ;
165
+ php_pollfd * fds ;
166
166
int index ;
167
167
} poll_build_context ;
168
168
169
- /* Callback to build pollfd array from fd_table */
169
+ /* Callback to build php_pollfd array from fd_table */
170
170
static bool poll_build_fds_callback (int fd , php_poll_fd_entry * entry , void * user_data )
171
171
{
172
172
poll_build_context * ctx = (poll_build_context * ) user_data ;
@@ -197,8 +197,8 @@ static int poll_backend_wait(php_poll_ctx *ctx, php_poll_event *events, int max_
197
197
198
198
/* Ensure temp_fds array is large enough */
199
199
if (fd_count > backend_data -> temp_fds_capacity ) {
200
- struct pollfd * new_fds = php_poll_realloc (
201
- backend_data -> temp_fds , fd_count * sizeof (struct pollfd ), ctx -> persistent );
200
+ php_pollfd * new_fds = php_poll_realloc (
201
+ backend_data -> temp_fds , fd_count * sizeof (php_pollfd ), ctx -> persistent );
202
202
if (!new_fds ) {
203
203
php_poll_set_error (ctx , PHP_POLL_ERR_NOMEM );
204
204
return -1 ;
@@ -207,7 +207,7 @@ static int poll_backend_wait(php_poll_ctx *ctx, php_poll_event *events, int max_
207
207
backend_data -> temp_fds_capacity = fd_count ;
208
208
}
209
209
210
- /* Build pollfd array from fd_table */
210
+ /* Build php_pollfd array from fd_table */
211
211
poll_build_context build_ctx = { .fds = backend_data -> temp_fds , .index = 0 };
212
212
php_poll_fd_table_foreach (backend_data -> fd_table , poll_build_fds_callback , & build_ctx );
213
213
@@ -218,10 +218,10 @@ static int poll_backend_wait(php_poll_ctx *ctx, php_poll_event *events, int max_
218
218
return nfds ; /* Return 0 for timeout, -1 for error */
219
219
}
220
220
221
- /* Process results - iterate through pollfd array directly */
221
+ /* Process results - iterate through php_pollfd array directly */
222
222
int event_count = 0 ;
223
223
for (int i = 0 ; i < fd_count && event_count < max_events ; i ++ ) {
224
- struct pollfd * pfd = & backend_data -> temp_fds [i ];
224
+ php_pollfd * pfd = & backend_data -> temp_fds [i ];
225
225
226
226
if (pfd -> revents != 0 ) {
227
227
php_poll_fd_entry * entry = php_poll_fd_table_find (backend_data -> fd_table , pfd -> fd );
0 commit comments