1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 08:38:49 -05:00

examples/ephiperfifo: report error when epoll_ctl fails

This commit is contained in:
Romain Fliedel 2018-11-05 11:46:56 +01:00 committed by Daniel Stenberg
parent 7c96f6a14b
commit 47ccb2d204
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -257,7 +257,9 @@ static void remsock(SockInfo *f, GlobalInfo* g)
{
if(f) {
if(f->sockfd) {
epoll_ctl(g->epfd, EPOLL_CTL_DEL, f->sockfd, NULL);
if(epoll_ctl(g->epfd, EPOLL_CTL_DEL, f->sockfd, NULL))
fprintf(stderr, "EPOLL_CTL_DEL failed for fd: %d : %s\n",
f->sockfd, strerror(errno));
}
free(f);
}
@ -274,7 +276,9 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
(act & CURL_POLL_OUT ? EPOLLOUT : 0);
if(f->sockfd) {
epoll_ctl(g->epfd, EPOLL_CTL_DEL, f->sockfd, NULL);
if(epoll_ctl(g->epfd, EPOLL_CTL_DEL, f->sockfd, NULL))
fprintf(stderr, "EPOLL_CTL_DEL failed for fd: %d : %s\n",
f->sockfd, strerror(errno));
}
f->sockfd = s;
@ -283,7 +287,9 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act,
ev.events = kind;
ev.data.fd = s;
epoll_ctl(g->epfd, EPOLL_CTL_ADD, s, &ev);
if(epoll_ctl(g->epfd, EPOLL_CTL_ADD, s, &ev))
fprintf(stderr, "EPOLL_CTL_ADD failed for fd: %d : %s\n",
s, strerror(errno));
}