pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/net/libfetch/files
Module Name: pkgsrc
Committed By: wiz
Date: Thu Apr 16 10:34:47 UTC 2026
Modified Files:
pkgsrc/net/libfetch/files: common.c
Log Message:
libfetch: remove HALL_POLL code again
src/ has been fixed to not need it
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 pkgsrc/net/libfetch/files/common.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/net/libfetch/files/common.c
diff -u pkgsrc/net/libfetch/files/common.c:1.37 pkgsrc/net/libfetch/files/common.c:1.38
--- pkgsrc/net/libfetch/files/common.c:1.37 Thu Apr 16 09:58:35 2026
+++ pkgsrc/net/libfetch/files/common.c Thu Apr 16 10:34:47 2026
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.37 2026/04/16 09:58:35 wiz Exp $ */
+/* $NetBSD: common.c,v 1.38 2026/04/16 10:34:47 wiz Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg%NetBSD.org@localhost>
@@ -41,14 +41,11 @@
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/uio.h>
-#if defined(HAVE_POLL_H) || defined(NETBSD)
+#if HAVE_POLL_H
#include <poll.h>
-#define HAVE_POLL
#elif HAVE_SYS_POLL_H
-#define HAVE_POLL
#include <sys/poll.h>
#endif
-
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -243,9 +240,7 @@ fetch_reopen(int sd)
conn->next_buf = NULL;
conn->next_len = 0;
conn->sd = sd;
-#ifdef HAVE_POLL
conn->buf_events = POLLIN;
-#endif
return (conn);
}
@@ -517,7 +512,6 @@ fetch_ssl(conn_t *conn, const struct url
#endif
}
-#ifdef HAVE_POLL
static int
compute_timeout(const struct timeval *tv)
{
@@ -528,7 +522,6 @@ compute_timeout(const struct timeval *tv
timeout = (tv->tv_sec - cur.tv_sec) * 1000 + (tv->tv_usec - cur.tv_usec) / 1000;
return timeout;
}
-#endif
/*
* Read a character from a connection w/ timeout
@@ -537,11 +530,7 @@ ssize_t
fetch_read(conn_t *conn, char *buf, size_t len)
{
struct timeval timeout_end;
-#ifdef HAVE_POLL
struct pollfd pfd;
-#else
- fd_set readfds;
-#endif
int timeout_cur;
ssize_t rlen;
int r;
@@ -559,16 +548,12 @@ fetch_read(conn_t *conn, char *buf, size
}
if (fetchTimeout) {
-#ifndef HAVE_POLL
- FD_ZERO(&readfds);
-#endif
gettimeofday(&timeout_end, NULL);
timeout_end.tv_sec += fetchTimeout;
}
+ pfd.fd = conn->sd;
for (;;) {
-#ifdef HAVE_POLL
- pfd.fd = conn->sd;
pfd.events = conn->buf_events;
if (fetchTimeout && pfd.events) {
do {
@@ -587,31 +572,6 @@ fetch_read(conn_t *conn, char *buf, size
return (-1);
}
} while (pfd.revents == 0);
-#else
- while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) {
- struct timeval waittv, now;
- FD_SET(conn->sd, &readfds);
- gettimeofday(&now, NULL);
- waittv.tv_sec = timeout_end.tv_sec - now.tv_sec;
- waittv.tv_usec = timeout_end.tv_usec - now.tv_usec;
- if (waittv.tv_usec < 0) {
- waittv.tv_usec += 1000000;
- waittv.tv_sec--;
- }
- if (waittv.tv_sec < 0) {
- errno = ETIMEDOUT;
- fetch_syserr();
- return (-1);
- }
- errno = 0;
- r = select(conn->sd + 1, &readfds, NULL, NULL, &waittv);
- if (r == -1) {
- if (errno == EINTR && fetchRestartCalls)
- continue;
- fetch_syserr();
- return (-1);
- }
-#endif
}
#ifdef WITH_SSL
if (conn->ssl != NULL) {
Home |
Main Index |
Thread Index |
Old Index