diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-12 21:08:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-12 21:08:16 +0000 |
commit | 679f9767ea6246b02ce4e8142083878ffb99e4cb (patch) | |
tree | 93c6a5781ee409ae9a3b2db88dc0399e33e650fb /src/os.c | |
parent | Releasing debian version 2.4.2+debian-2. (diff) | |
download | dnsperf-679f9767ea6246b02ce4e8142083878ffb99e4cb.tar.xz dnsperf-679f9767ea6246b02ce4e8142083878ffb99e4cb.zip |
Merging upstream version 2.5.0+debian.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/os.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -61,11 +61,12 @@ void perf_os_handlesignal(int sig, void (*handler)(int)) perf_result_t perf_os_waituntilreadable(struct perf_net_socket* sock, int pipe_fd, int64_t timeout) { - return perf_os_waituntilanyreadable(sock, 1, pipe_fd, timeout); + struct perf_net_socket* socks[] = { sock }; + return perf_os_waituntilanyreadable(socks, 1, pipe_fd, timeout); } perf_result_t -perf_os_waituntilanyreadable(struct perf_net_socket* socks, unsigned int nfds, int pipe_fd, +perf_os_waituntilanyreadable(struct perf_net_socket** socks, unsigned int nfds, int pipe_fd, int64_t timeout) { struct pollfd fds[nfds + 1]; @@ -73,10 +74,10 @@ perf_os_waituntilanyreadable(struct perf_net_socket* socks, unsigned int nfds, i int to, n; for (i = 0; i < nfds; i++) { - if (socks[i].have_more) + if (perf_net_have_more(socks[i])) return (PERF_R_SUCCESS); - fds[i].fd = socks[i].fd; + fds[i].fd = socks[i]->fd; fds[i].events = POLLIN; } @@ -109,7 +110,7 @@ perf_os_waituntilanyreadable(struct perf_net_socket* socks, unsigned int nfds, i } perf_result_t -perf_os_waituntilanywritable(struct perf_net_socket* socks, unsigned int nfds, int pipe_fd, +perf_os_waituntilanywritable(struct perf_net_socket** socks, unsigned int nfds, int pipe_fd, int64_t timeout) { struct pollfd fds[nfds + 1]; @@ -117,7 +118,7 @@ perf_os_waituntilanywritable(struct perf_net_socket* socks, unsigned int nfds, i int to, n; for (i = 0; i < nfds; i++) { - fds[i].fd = socks[i].fd; + fds[i].fd = socks[i]->fd; fds[i].events = POLLOUT; } |