Skip to content

Commit 79178c9

Browse files
committed
pgsql: Use php_pollfd_for_ms in compat shim
This is only used on pre-libpq 17.
1 parent 17e4fa7 commit 79178c9

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

ext/pgsql/pgsql.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,19 +448,14 @@ static int PQsocketPoll(int socket, int read, int write, time_t timeout)
448448
if (!read && !write)
449449
return 0;
450450

451-
php_pollfd fd;
452-
int ts = -1;
453-
454-
fd.fd = socket;
455-
fd.events = POLLERR;
456-
fd.revents = 0;
451+
int ts = -1, events = 0;
457452

458453
if (read) {
459-
fd.events |= POLLIN;
454+
events |= POLLIN;
460455
}
461456

462457
if (write) {
463-
fd.events |= POLLOUT;
458+
events |= POLLOUT;
464459
}
465460

466461
if (timeout != (time_t)ts) {
@@ -473,7 +468,7 @@ static int PQsocketPoll(int socket, int read, int write, time_t timeout)
473468
}
474469
}
475470

476-
return php_poll2(&fd, 1, ts);
471+
return php_pollfd_for_ms(socket, events, ts);
477472
}
478473
#endif
479474

0 commit comments

Comments
 (0)