commit fa3a678a65b6b857c2db10bf0c30d6b38be17af0
parent dff9366c931b22e13eb96618d6e3762347546db7
Author: sin <sin@2f30.org>
Date: Tue, 12 Apr 2016 23:06:32 +0100
init pfd once
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/auth.c b/auth.c
@@ -22,9 +22,9 @@ challenge(int netfd)
if (netwrite(netfd, buf, sizeof(buf), &outlen) == PKTFAILED)
return -1;
+ pfd[0].fd = netfd;
+ pfd[0].events = POLLIN;
for (;;) {
- pfd[0].fd = netfd;
- pfd[0].events = POLLIN;
ret = poll(pfd, 1, AUTHTIMEO);
if (ret < 0) {
logwarn("poll failed");
@@ -59,9 +59,9 @@ response(int netfd)
uint64_t reply;
int ret;
+ pfd[0].fd = netfd;
+ pfd[0].events = POLLIN;
for (;;) {
- pfd[0].fd = netfd;
- pfd[0].events = POLLIN;
ret = poll(pfd, 1, AUTHTIMEO);
if (ret < 0) {
logwarn("poll failed");